Package loci.poi.hssf.record
Class SharedFormulaRecord
- java.lang.Object
-
- loci.poi.hssf.record.Record
-
- loci.poi.hssf.record.SharedFormulaRecord
-
public class SharedFormulaRecord extends Record
Title: SharedFormulaRecord Description: Primarily used as an excel optimization so that multiple similar formulas are not written out too many times. We should recognize this record and serialize as is since this is used when reading templates.Note: the documentation says that the SID is BC where biffviewer reports 4BC. The hex dump shows that the two byte sid representation to be 'BC 04' that is consistent with the other high byte record types.
- Author:
- Danny Mui at apache dot org
-
-
Field Summary
Fields Modifier and Type Field Description static shortsid
-
Constructor Summary
Constructors Constructor Description SharedFormulaRecord()SharedFormulaRecord(RecordInputStream in)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()voidconvertSharedFormulaRecord(FormulaRecord formula)Creates a non shared formula from the shared formula counter partprotected voidfillFields(RecordInputStream in)Shared formulas are to treated like unknown records, and as a result dshortgetExpressionLength()shortgetFirstColumn()intgetFirstRow()shortgetLastColumn()intgetLastRow()intgetRecordSize()gives the current serialized size of the record.shortgetSid()return the non static version of the id for this record.booleanisFormulaInShared(FormulaRecord formula)booleanisInValueSection()Mirroring formula records so it is registered in the ValueRecordsAggregatebooleanisValue()Register it in the ValueRecordsAggregate so it can go into the FormulaRecordAggregateintserialize(int offset, byte[] data)spit the record out AS IS.java.lang.StringtoString()print a sort of string representation ([SHARED FORMULA RECORD] id = x [/SHARED FORMULA RECORD])protected voidvalidateSid(short id)called by constructor, should throw runtime exception in the event of a record passed with a differing ID.
-
-
-
Field Detail
-
sid
public static final short sid
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SharedFormulaRecord
public SharedFormulaRecord()
-
SharedFormulaRecord
public SharedFormulaRecord(RecordInputStream in)
- Parameters:
in- the RecordInputstream to read the record from
-
-
Method Detail
-
validateSid
protected void validateSid(short id)
Description copied from class:Recordcalled by constructor, should throw runtime exception in the event of a record passed with a differing ID.- Specified by:
validateSidin classRecord- Parameters:
id- alleged id for this record
-
getFirstRow
public int getFirstRow()
-
getLastRow
public int getLastRow()
-
getFirstColumn
public short getFirstColumn()
-
getLastColumn
public short getLastColumn()
-
getExpressionLength
public short getExpressionLength()
-
serialize
public int serialize(int offset, byte[] data)spit the record out AS IS. no interperatation or identification
-
getRecordSize
public int getRecordSize()
Description copied from class:Recordgives the current serialized size of the record. Should include the sid and reclength (4 bytes).- Overrides:
getRecordSizein classRecord
-
toString
public java.lang.String toString()
print a sort of string representation ([SHARED FORMULA RECORD] id = x [/SHARED FORMULA RECORD])
-
getSid
public short getSid()
Description copied from class:Recordreturn the non static version of the id for this record.
-
fillFields
protected void fillFields(RecordInputStream in)
Shared formulas are to treated like unknown records, and as a result d- Specified by:
fillFieldsin classRecord- Parameters:
in- the RecordInputstream to read the record from
-
isFormulaInShared
public boolean isFormulaInShared(FormulaRecord formula)
-
convertSharedFormulaRecord
public void convertSharedFormulaRecord(FormulaRecord formula)
Creates a non shared formula from the shared formula counter part
-
isInValueSection
public boolean isInValueSection()
Mirroring formula records so it is registered in the ValueRecordsAggregate- Overrides:
isInValueSectionin classRecord
-
isValue
public boolean isValue()
Register it in the ValueRecordsAggregate so it can go into the FormulaRecordAggregate
-
-