Class FormulaRecordAggregate
- java.lang.Object
-
- org.apache.poi.hssf.record.RecordBase
-
- org.apache.poi.hssf.record.aggregates.RecordAggregate
-
- org.apache.poi.hssf.record.aggregates.FormulaRecordAggregate
-
- All Implemented Interfaces:
CellValueRecordInterface
public final class FormulaRecordAggregate extends RecordAggregate implements CellValueRecordInterface
The formula record aggregate is used to join together the formula record and it's (optional) string record and (optional) Shared Formula Record (template reads, excel optimization).
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.poi.hssf.record.aggregates.RecordAggregate
RecordAggregate.PositionTrackingVisitor, RecordAggregate.RecordVisitor
-
-
Constructor Summary
Constructors Constructor Description FormulaRecordAggregate(FormulaRecord formulaRec, StringRecord stringRec, SharedValueManager svm)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CellRangeAddress
getArrayFormulaRange()
short
getColumn()
FormulaRecord
getFormulaRecord()
Ptg[]
getFormulaTokens()
int
getRow()
StringRecord
getStringRecord()
debug only TODO - encapsulateString
getStringValue()
short
getXFIndex()
boolean
isPartOfArrayFormula()
void
notifyFormulaChanging()
Should be called by any code which is either deleting this formula cell, or changing its type.CellRangeAddress
removeArrayFormula(int rowIndex, int columnIndex)
Removes an array formulavoid
setArrayFormula(CellRangeAddress r, Ptg[] ptgs)
void
setCachedBooleanResult(boolean value)
void
setCachedDoubleResult(double value)
void
setCachedErrorResult(int errorCode)
void
setCachedErrorResult(FormulaError error)
void
setCachedStringResult(String value)
void
setColumn(short col)
void
setParsedExpression(Ptg[] ptgs)
Also checks for a related shared formula and unlinks it if foundvoid
setRow(int row)
void
setXFIndex(short xf)
String
toString()
void
unlinkSharedFormula()
void
visitContainedRecords(RecordAggregate.RecordVisitor rv)
Visit each of the atomic BIFF records contained in this RecordAggregate in the order that they should be written to file.-
Methods inherited from class org.apache.poi.hssf.record.aggregates.RecordAggregate
getRecordSize, serialize
-
-
-
-
Constructor Detail
-
FormulaRecordAggregate
public FormulaRecordAggregate(FormulaRecord formulaRec, StringRecord stringRec, SharedValueManager svm)
- Parameters:
stringRec
- may benull
if this formula does not have a cached text value.svm
- theSharedValueManager
for the current sheet
-
-
Method Detail
-
getFormulaRecord
public FormulaRecord getFormulaRecord()
-
getStringRecord
public StringRecord getStringRecord()
debug only TODO - encapsulate
-
getXFIndex
public short getXFIndex()
- Specified by:
getXFIndex
in interfaceCellValueRecordInterface
-
setXFIndex
public void setXFIndex(short xf)
- Specified by:
setXFIndex
in interfaceCellValueRecordInterface
-
setColumn
public void setColumn(short col)
- Specified by:
setColumn
in interfaceCellValueRecordInterface
- Parameters:
col
- the column this cell defines
-
setRow
public void setRow(int row)
- Specified by:
setRow
in interfaceCellValueRecordInterface
- Parameters:
row
- the row this cell occurs within
-
getColumn
public short getColumn()
- Specified by:
getColumn
in interfaceCellValueRecordInterface
- Returns:
- the column this cell defines within the row
-
getRow
public int getRow()
- Specified by:
getRow
in interfaceCellValueRecordInterface
- Returns:
- the row this cell occurs on
-
visitContainedRecords
public void visitContainedRecords(RecordAggregate.RecordVisitor rv)
Description copied from class:RecordAggregate
Visit each of the atomic BIFF records contained in this RecordAggregate in the order that they should be written to file. Implementors may or may not return the actualRecord
s being used to manage POI's internal implementation. Callers should not assume either way, and therefore only attempt to modify thoseRecord
s after cloning- Specified by:
visitContainedRecords
in classRecordAggregate
- Parameters:
rv
- The visitor to use for callbacks while walking this object
-
getStringValue
public String getStringValue()
-
setCachedStringResult
public void setCachedStringResult(String value)
-
setCachedBooleanResult
public void setCachedBooleanResult(boolean value)
-
setCachedErrorResult
public void setCachedErrorResult(int errorCode)
-
setCachedErrorResult
public void setCachedErrorResult(FormulaError error)
-
setCachedDoubleResult
public void setCachedDoubleResult(double value)
-
getFormulaTokens
public Ptg[] getFormulaTokens()
-
setParsedExpression
public void setParsedExpression(Ptg[] ptgs)
Also checks for a related shared formula and unlinks it if found
-
unlinkSharedFormula
public void unlinkSharedFormula()
-
notifyFormulaChanging
public void notifyFormulaChanging()
Should be called by any code which is either deleting this formula cell, or changing its type. This method gives the aggregate a chance to unlink any shared formula that may be involved with this cell formula.
-
isPartOfArrayFormula
public boolean isPartOfArrayFormula()
-
getArrayFormulaRange
public CellRangeAddress getArrayFormulaRange()
-
setArrayFormula
public void setArrayFormula(CellRangeAddress r, Ptg[] ptgs)
-
removeArrayFormula
public CellRangeAddress removeArrayFormula(int rowIndex, int columnIndex)
Removes an array formula- Returns:
- the range of the array formula containing the specified cell. Never
null
-
-