org.apache.poi.hssf.record
Class Record

java.lang.Object
  |
  +--org.apache.poi.hssf.record.Record
Direct Known Subclasses:
AreaFormatRecord, AreaRecord, AxisRecord, AxisUsedRecord, BackupRecord, BarRecord, BeginRecord, BlankRecord, BOFRecord, BookBoolRecord, BoolErrRecord, BoundSheetRecord, CalcCountRecord, CalcModeRecord, CategorySeriesAxisRecord, ChartFormatRecord, ChartRecord, CodepageRecord, ColumnInfoRecord, ContinueRecord, CountryRecord, DataFormatRecord, DateWindow1904Record, DatRecord, DBCellRecord, DefaultColWidthRecord, DefaultDataLabelTextPropertiesRecord, DefaultRowHeightRecord, DeltaRecord, DimensionsRecord, DSFRecord, EndRecord, EOFRecord, ExtendedFormatRecord, ExtSSTInfoSubRecord, ExtSSTRecord, FnGroupCountRecord, FontBasisRecord, FontIndexRecord, FontRecord, FooterRecord, FormatRecord, FormulaRecord, FrameRecord, GridsetRecord, GutsRecord, HCenterRecord, HeaderRecord, HideObjRecord, IndexRecord, InterfaceEndRecord, InterfaceHdrRecord, IterationRecord, LabelRecord, LabelSSTRecord, LegendRecord, LineFormatRecord, LinkedDataRecord, MergeCellsRecord, MMSRecord, MulBlankRecord, MulRKRecord, NumberFormatIndexRecord, NumberRecord, PasswordRecord, PasswordRev4Record, PlotGrowthRecord, PrecisionRecord, PrintGridlinesRecord, PrintHeadersRecord, PrintSetupRecord, ProtectionRev4Record, ProtectRecord, RefModeRecord, RefreshAllRecord, RKRecord, RowRecord, RowRecordsAggregate, SaveRecalcRecord, SelectionRecord, SeriesChartGroupIndexRecord, SeriesLabelsRecord, SeriesListRecord, SeriesRecord, SheetPropertiesRecord, SSTRecord, StyleRecord, TabIdRecord, UnicodeString, UnitsRecord, UnknownRecord, UseSelFSRecord, ValueRangeRecord, ValueRecordsAggregate, VCenterRecord, WindowOneRecord, WindowProtectRecord, WindowTwoRecord, WriteAccessRecord, WSBoolRecord

public abstract class Record
extends java.lang.Object

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:

Version:
2.0-pre
Author:
Andrew C. Oliver, Marc Johnson (mjohnson at apache dot org)

Field Summary
 short sid
          The static ID, subclasses should override this value with the id for the record type they handle.
 
Constructor Summary
Record()
          instantiates a blank record strictly for ID matching
Record(short id, short size, byte[] data)
          Constructor Record
Record(short id, short size, byte[] data, int offset)
          Constructor Record
 
Method Summary
protected  void fillFields(byte[] data, short size)
          called by the constructor, should set class level fields.
protected abstract  void fillFields(byte[] data, short size, int offset)
          called by the constructor, should set class level fields.
 int getRecordSize()
          gives the current serialized size of the record.
abstract  short getSid()
          return the non static version of the id for this record.
 boolean isInValueSection()
          DBCELL, ROW, VALUES all say yes
 boolean isValue()
          tells whether this type of record contains a value
 void processContinueRecord(byte[] record)
          Process a continuation record; default handling is to ignore it -- TODO add logging
 byte[] serialize()
          called by the class that is responsible for writing this sucker.
abstract  int serialize(int offset, byte[] data)
          called by the class that is responsible for writing this sucker.
 java.lang.String toString()
          get a string representation of the record (for biffview/debugging)
protected abstract  void validateSid(short id)
          called by constructor, should throw runtime exception in the event of a record passed with a differing ID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sid

public short sid
The static ID, subclasses should override this value with the id for the record type they handle.
Constructor Detail

Record

public Record()
instantiates a blank record strictly for ID matching

Record

public Record(short id,
              short size,
              byte[] data)
Constructor Record
Parameters:
id - record id
size - record size
data - raw data

Record

public Record(short id,
              short size,
              byte[] data,
              int offset)
Constructor Record
Parameters:
id - record id
size - record size
data - raw data
Method Detail

validateSid

protected abstract void validateSid(short id)
called by constructor, should throw runtime exception in the event of a record passed with a differing ID.
Parameters:
id - alleged id for this record

fillFields

protected void fillFields(byte[] data,
                          short size)
called by the constructor, should set class level fields. Should throw runtime exception for bad/icomplete data.
Parameters:
data - raw data

fillFields

protected abstract void fillFields(byte[] data,
                                   short size,
                                   int offset)
called by the constructor, should set class level fields. Should throw runtime exception for bad/icomplete data.
Parameters:
data - raw data
size - size of data
offset - of the record's data (provided a big array of the file)

serialize

public byte[] serialize()
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.
Returns:
byte array containing instance data

serialize

public abstract 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.
Parameters:
offset - to begin writing at
data - byte array containing instance data
Returns:
number of bytes written

getRecordSize

public int getRecordSize()
gives the current serialized size of the record.

isValue

public boolean isValue()
tells whether this type of record contains a value

isInValueSection

public boolean isInValueSection()
DBCELL, ROW, VALUES all say yes

toString

public java.lang.String toString()
get a string representation of the record (for biffview/debugging)
Overrides:
toString in class java.lang.Object

processContinueRecord

public void processContinueRecord(byte[] record)
Process a continuation record; default handling is to ignore it -- TODO add logging
Parameters:
record - the continuation record's data

getSid

public abstract short getSid()
return the non static version of the id for this record.


Copyright © 2002 Apache jakarta-poi project. All Rights Reserved.