org.apache.poi.hssf.record
abstract public class: Record [javadoc |
source]
java.lang.Object
org.apache.poi.hssf.record.Record
Direct Known Subclasses:
PlotGrowthRecord, CountryRecord, VCenterRecord, DrawingRecord, DBCellRecord, TopMarginRecord, SharedFormulaRecord, LabelRecord, ProtectRecord, MulRKRecord, CalcModeRecord, EscherAggregate, ExtSSTInfoSubRecord, DataFormatRecord, SSTRecord, MissingRowDummyRecord, NumberFormatIndexRecord, DrawingGroupRecord, EOFRecord, FontBasisRecord, RefModeRecord, PasswordRev4Record, ChartFormatRecord, CFHeaderRecord, SeriesLabelsRecord, SaveRecalcRecord, BoolErrRecord, CFRuleRecord, SheetPropertiesRecord, PrintHeadersRecord, WindowTwoRecord, StringRecord, GutsRecord, UncalcedRecord, HeaderRecord, ScenarioProtectRecord, RowRecordsAggregate, HorizontalPageBreakRecord, BoundSheetRecord, RowRecord, FrameRecord, ExtSSTRecord, BottomMarginRecord, MissingCellDummyRecord, GroupMarkerSubRecord, SeriesListRecord, FontRecord, DatRecord, RecalcIdRecord, PasswordRecord, ColumnInfoRecord, ExternSheetSubRecord, FilePassRecord, PrecisionRecord, ExternalNameRecord, CRNCountRecord, NumberRecord, ExternSheetRecord, PageBreakRecord, NoteStructureSubRecord, FormatRecord, PaneRecord, DefaultDataLabelTextPropertiesRecord, GridsetRecord, FooterRecord, TableRecord, DVALRecord, ProtectionRev4Record, SCLRecord, FileSharingRecord, AxisParentRecord, BookBoolRecord, ColumnInfoRecordsAggregate, NameRecord, ObjRecord, SeriesChartGroupIndexRecord, WindowProtectRecord, DrawingSelectionRecord, EndRecord, SharedValueRecordBase, UnknownRecord, MulBlankRecord, AbstractEscherHolderRecord, SelectionRecord, BOFRecord, MergeCellsRecord, DefaultColWidthRecord, WriteAccessRecord, ObjectProtectRecord, LegendRecord, AxisRecord, HyperlinkRecord, DateWindow1904Record, ChartTitleFormatRecord, VerticalPageBreakRecord, CFRecordsAggregate, LastCellOfRowDummyRecord, TabIdRecord, RKRecord, LabelSSTRecord, ExtendedFormatRecord, SeriesRecord, FnGroupCountRecord, FontIndexRecord, HCenterRecord, ObjectLinkRecord, EmbeddedObjectRefSubRecord, SeriesIndexRecord, MMSRecord, IterationRecord, CalcCountRecord, UnitsRecord, ArrayRecord, TextObjectBaseRecord, LineFormatRecord, LeftMarginRecord, WindowOneRecord, FormulaRecord, AxisUsedRecord, DimensionsRecord, ChartRecord, CommonObjectDataSubRecord, BackupRecord, WSBoolRecord, DSFRecord, TextRecord, PrintSetupRecord, SeriesTextRecord, AxisOptionsRecord, ContinueRecord, TextObjectRecord, CategorySeriesAxisRecord, PrintGridlinesRecord, DefaultRowHeightRecord, FormulaRecordAggregate, AxisLineFormatRecord, InterfaceHdrRecord, BarRecord, DeltaRecord, DrawingRecordForBiffViewer, ValueRangeRecord, AreaFormatRecord, TickRecord, NoteRecord, HideObjRecord, InterfaceEndRecord, ValueRecordsAggregate, BeginRecord, CodepageRecord, BlankRecord, AreaRecord, WriteProtectRecord, StyleRecord, RefreshAllRecord, SubRecord, RightMarginRecord, CRNRecord, LinkedDataRecord, IndexRecord, UseSelFSRecord, SeriesToChartGroupRecord, PlotAreaRecord, EndSubRecord, DVRecord, PaletteRecord, SupBookRecord
Title: Record
Description: All HSSF Records inherit from this class. It
populates the fields common to all records (id, size and data).
Subclasses should be sure to validate the id,
Company:
- author:
Andrew - C. Oliver
- author:
Marc - Johnson (mjohnson at apache dot org)
- author:
Jason - Height (jheight at chariot dot net dot au)
- version:
2.0-pre -
| Method from org.apache.poi.hssf.record.Record Summary: |
|---|
|
clone, cloneViaReserialise, fillFields, getRecordSize, getSid, isInValueSection, isValue, serialize, serialize, toString, validateSid |
| Method from org.apache.poi.hssf.record.Record Detail: |
public Object clone() {
throw new RuntimeException("The class "+getClass().getName()+" needs to define a clone method");
}
|
public Record cloneViaReserialise() {
// Do it via a re-serialise
// It's a cheat, but it works...
byte[] b = serialize();
RecordInputStream rinp = new RecordInputStream(
new ByteArrayInputStream(b)
);
rinp.nextRecord();
Record[] r = RecordFactory.createRecord(rinp);
if(r.length != 1) {
throw new IllegalStateException("Re-serialised a record to clone it, but got " + r.length + " records back!");
}
return r[0];
}
Clone the current record, via a call to serialise
it, and another to create a new record from the
bytes.
May only be used for classes which don't have
internal counts / ids in them. For those which
do, a full record-aware serialise is needed, which
allocates new ids / counts as needed. |
abstract protected void fillFields(RecordInputStream in)
called by the constructor, should set class level fields. Should throw
runtime exception for bad/icomplete data. |
public int getRecordSize() {
// this is kind od a stupid way to do it but for now we just serialize
// the record and return the size of the byte array
return serialize().length;
}
gives the current serialized size of the record. Should include the sid and reclength (4 bytes). |
abstract public short getSid()
return the non static version of the id for this record. |
public boolean isInValueSection() {
return false;
}
DBCELL, ROW, VALUES all say yes |
public boolean isValue() {
return false;
}
tells whether this type of record contains a value |
public byte[] serialize() {
byte[] retval = new byte[ getRecordSize() ];
serialize(0, retval);
return retval;
}
called by the class that is responsible for writing this sucker.
Subclasses should implement this so that their data is passed back in a
byte array. |
abstract public int serialize(int offset,
byte[] data)
called by the class that is responsible for writing this sucker.
Subclasses should implement this so that their data is passed back in a
byte array. |
public String toString() {
return super.toString();
}
get a string representation of the record (for biffview/debugging) |
abstract protected void validateSid(short id)
called by constructor, should throw runtime exception in the event of a
record passed with a differing ID. |