Package org.apache.poi.hssf.record
Class SharedFormulaRecord
- java.lang.Object
-
- org.apache.poi.hssf.record.RecordBase
-
- org.apache.poi.hssf.record.Record
-
- org.apache.poi.hssf.record.StandardRecord
-
- org.apache.poi.hssf.record.SharedValueRecordBase
-
- org.apache.poi.hssf.record.SharedFormulaRecord
-
- All Implemented Interfaces:
Duplicatable
,GenericRecord
public final class SharedFormulaRecord extends SharedValueRecordBase
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.
-
-
Field Summary
Fields Modifier and Type Field Description static short
sid
-
Constructor Summary
Constructors Constructor Description SharedFormulaRecord()
SharedFormulaRecord(RecordInputStream in)
SharedFormulaRecord(SharedFormulaRecord other)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SharedFormulaRecord
copy()
protected int
getExtraDataSize()
Ptg[]
getFormulaTokens(FormulaRecord formula)
Convert formula into an array ofPtg
tokens.Map<String,Supplier<?>>
getGenericProperties()
HSSFRecordTypes
getGenericRecordType()
short
getSid()
return the non static version of the id for this record.boolean
isFormulaSame(SharedFormulaRecord other)
protected void
serializeExtraData(LittleEndianOutput out)
-
Methods inherited from class org.apache.poi.hssf.record.SharedValueRecordBase
getDataSize, getFirstColumn, getFirstRow, getLastColumn, getLastRow, getRange, isFirstCell, isInRange, serialize
-
Methods inherited from class org.apache.poi.hssf.record.StandardRecord
getRecordSize, serialize
-
Methods inherited from class org.apache.poi.hssf.record.Record
cloneViaReserialise, serialize, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.poi.common.usermodel.GenericRecord
getGenericChildren
-
-
-
-
Field Detail
-
sid
public static final short sid
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SharedFormulaRecord
public SharedFormulaRecord()
-
SharedFormulaRecord
public SharedFormulaRecord(SharedFormulaRecord other)
-
SharedFormulaRecord
public SharedFormulaRecord(RecordInputStream in)
- Parameters:
in
- the RecordInputstream to read the record from
-
-
Method Detail
-
serializeExtraData
protected void serializeExtraData(LittleEndianOutput out)
- Specified by:
serializeExtraData
in classSharedValueRecordBase
-
getExtraDataSize
protected int getExtraDataSize()
- Specified by:
getExtraDataSize
in classSharedValueRecordBase
-
getSid
public short getSid()
Description copied from class:Record
return the non static version of the id for this record.
-
getFormulaTokens
public Ptg[] getFormulaTokens(FormulaRecord formula)
Convert formula into an array ofPtg
tokens.- Parameters:
formula
- The record to break into tokens, cannot be null- Returns:
- the equivalent
Ptg
array that the formula would have, were it not shared.
-
copy
public SharedFormulaRecord copy()
- Specified by:
copy
in interfaceDuplicatable
- Specified by:
copy
in classStandardRecord
- Returns:
- a deep copy of the implementing class / instance
-
isFormulaSame
public boolean isFormulaSame(SharedFormulaRecord other)
-
getGenericRecordType
public HSSFRecordTypes getGenericRecordType()
- Specified by:
getGenericRecordType
in interfaceGenericRecord
- Specified by:
getGenericRecordType
in classRecord
-
-