org.apache.poi.hssf.record
Class SharedFormulaRecord

java.lang.Object
  extended by org.apache.poi.hssf.record.RecordBase
      extended by org.apache.poi.hssf.record.Record
          extended by org.apache.poi.hssf.record.StandardRecord
              extended by org.apache.poi.hssf.record.SharedValueRecordBase
                  extended by org.apache.poi.hssf.record.SharedFormulaRecord

public final class SharedFormulaRecord
extends SharedValueRecordBase

Title: SHAREDFMLA (0x04BC) 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.


Field Summary
static short sid
           
 
Constructor Summary
SharedFormulaRecord()
           
SharedFormulaRecord(RecordInputStream in)
           
 
Method Summary
 java.lang.Object clone()
           
protected  int getExtraDataSize()
           
 Ptg[] getFormulaTokens(FormulaRecord formula)
           
 short getSid()
          return the non static version of the id for this record.
 boolean isFormulaSame(SharedFormulaRecord other)
           
protected  void serializeExtraData(LittleEndianOutput out)
           
 java.lang.String toString()
          print a sort of string representation ([SHARED FORMULA RECORD] id = x [/SHARED FORMULA RECORD])
 
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
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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

serializeExtraData

protected void serializeExtraData(LittleEndianOutput out)
Specified by:
serializeExtraData in class SharedValueRecordBase

getExtraDataSize

protected int getExtraDataSize()
Specified by:
getExtraDataSize in class SharedValueRecordBase

toString

public java.lang.String toString()
print a sort of string representation ([SHARED FORMULA RECORD] id = x [/SHARED FORMULA RECORD])

Overrides:
toString in class Record

getSid

public short getSid()
Description copied from class: Record
return the non static version of the id for this record.

Specified by:
getSid in class Record
Returns:
he id for this record

getFormulaTokens

public Ptg[] getFormulaTokens(FormulaRecord formula)
Returns:
the equivalent Ptg array that the formula would have, were it not shared.

clone

public java.lang.Object clone()
Overrides:
clone in class Record

isFormulaSame

public boolean isFormulaSame(SharedFormulaRecord other)