Class SharedFormulaRecord

All Implemented Interfaces:
org.apache.poi.common.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 Details

  • Constructor Details

    • SharedFormulaRecord

      public SharedFormulaRecord()
    • SharedFormulaRecord

      public SharedFormulaRecord(SharedFormulaRecord other)
    • SharedFormulaRecord

      public SharedFormulaRecord(RecordInputStream in)
      Parameters:
      in - the RecordInputstream to read the record from
  • Method Details

    • 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)
      Convert formula into an array of Ptg 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 interface org.apache.poi.common.Duplicatable
      Specified by:
      copy in class StandardRecord
    • isFormulaSame

      public boolean isFormulaSame(SharedFormulaRecord other)
    • getGenericRecordType

      public HSSFRecordTypes getGenericRecordType()
      Specified by:
      getGenericRecordType in interface GenericRecord
      Specified by:
      getGenericRecordType in class Record
    • getGenericProperties

      public Map<String,Supplier<?>> getGenericProperties()