Top Description Fields Constructors Methods
org.apache.poi.hssf.record

public final Class SharedFormulaRecord

extends SharedValueRecordBase
Class Inheritance
Imports
java.util.Map, java.util.function.Supplier, org.apache.poi.hssf.util.CellRangeAddress8Bit, org.apache.poi.ss.SpreadsheetVersion, org.apache.poi.ss.formula.Formula, .SharedFormula, org.apache.poi.ss.formula.ptg.Ptg, org.apache.poi.util.GenericRecordUtil, .LittleEndianOutput

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

Modifier and TypeField and Description
private int
private Formula
public static final short

Constructor Summary

AccessConstructor and Description
public
public
private
public
SharedFormulaRecord(RecordInputStream
the RecordInputstream to read the record from
in
)

Method Summary

Modifier and TypeMethod and Description
public SharedFormulaRecord
protected int
public Ptg[]

Returns:

the equivalent Ptg array that the formula would have, were it not shared.
getFormulaTokens
(FormulaRecord
The record to break into tokens, cannot be null
formula
)

Convert formula into an array of Ptg tokens.

public Map<String, Supplier<?>>
public HSSFRecordTypes
public short
getSid()

Implements abstract org.apache.poi.hssf.record.Record.getSid.

return the non static version of the id for this record.

public boolean
protected void
Inherited from org.apache.poi.hssf.record.SharedValueRecordBase:
getDataSizegetFirstColumngetFirstRowgetLastColumngetLastRowgetRangeisFirstCellisInRangeserialize

Field Detail

field_5_reservedback to summary
private int field_5_reserved
field_7_parsed_exprback to summary
private Formula field_7_parsed_expr
sidback to summary
public static final short sid

Constructor Detail

SharedFormulaRecordback to summary
public SharedFormulaRecord()
SharedFormulaRecordback to summary
public SharedFormulaRecord(SharedFormulaRecord other)
SharedFormulaRecordback to summary
private SharedFormulaRecord(CellRangeAddress8Bit range)
SharedFormulaRecordback to summary
public SharedFormulaRecord(RecordInputStream in)
Parameters
in:RecordInputStream

the RecordInputstream to read the record from

Method Detail

copyback to summary
public SharedFormulaRecord copy()

Implements abstract org.apache.poi.hssf.record.StandardRecord.copy.

Implements org.apache.poi.common.Duplicatable.copy.

Returns:SharedFormulaRecord

Doc from org.apache.poi.common.Duplicatable.copy.

a deep copy of the implementing class / instance

Annotations
@Override
getExtraDataSizeback to summary
protected int getExtraDataSize()

Implements abstract org.apache.poi.hssf.record.SharedValueRecordBase.getExtraDataSize.

getFormulaTokensback to summary
public Ptg[] getFormulaTokens(FormulaRecord formula)

Convert formula into an array of Ptg tokens.

Parameters
formula:FormulaRecord

The record to break into tokens, cannot be null

Returns:Ptg[]

the equivalent Ptg array that the formula would have, were it not shared.

getGenericPropertiesback to summary
public Map<String, Supplier<?>> getGenericProperties()

Implements org.apache.poi.common.usermodel.GenericRecord.getGenericProperties.

Annotations
@Override
getGenericRecordTypeback to summary
public HSSFRecordTypes getGenericRecordType()

Overrides default org.apache.poi.common.usermodel.GenericRecord.getGenericRecordType.

Implements abstract org.apache.poi.hssf.record.Record.getGenericRecordType.

Annotations
@Override
getSidback to summary
public short getSid()

Implements abstract org.apache.poi.hssf.record.Record.getSid.

Doc from org.apache.poi.hssf.record.Record.getSid.

return the non static version of the id for this record.

Returns:short

he id for this record

isFormulaSameback to summary
public boolean isFormulaSame(SharedFormulaRecord other)
serializeExtraDataback to summary
protected void serializeExtraData(LittleEndianOutput out)

Implements abstract org.apache.poi.hssf.record.SharedValueRecordBase.serializeExtraData.