Package org.apache.poi.hssf.record
Class FormulaRecord
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.CellRecord
org.apache.poi.hssf.record.FormulaRecord
- All Implemented Interfaces:
org.apache.poi.common.Duplicatable,GenericRecord,CellValueRecordInterface
Formula Record (0x0006).
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()booleanintintDeprecated.POI 5.0.0, will be removed in 6.0, use getCachedResultTypeEnum until switch to enum is fully doneReturns the type of the cached resultshortget the option flagsPtg[]shortgetSid()return the non static version of the id for this record.doublegetValue()get the calculated value of the formulabooleanbooleanbooleanbooleanvoidsetAlwaysCalc(boolean flag) voidsetCachedResultBoolean(boolean value) voidsetCachedResultErrorCode(int errorCode) voidvoidvoidsetCalcOnLoad(boolean flag) voidsetOptions(short options) set the option flagsvoidsetParsedExpression(Ptg[] ptgs) voidsetSharedFormula(boolean flag) voidsetValue(double value) set the calculated value of the formulaMethods inherited from class org.apache.poi.hssf.record.CellRecord
getColumn, getRow, getXFIndex, serialize, setColumn, setRow, setXFIndexMethods inherited from class org.apache.poi.hssf.record.StandardRecord
getRecordSize, serializeMethods inherited from class org.apache.poi.hssf.record.Record
cloneViaReserialise, serialize, toStringMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.poi.common.usermodel.GenericRecord
getGenericChildren
-
Field Details
-
sid
public static final short sid- See Also:
-
-
Constructor Details
-
FormulaRecord
public FormulaRecord()Creates new FormulaRecord -
FormulaRecord
-
FormulaRecord
-
-
Method Details
-
setValue
public void setValue(double value) set the calculated value of the formula- Parameters:
value- calculated value
-
setCachedResultTypeEmptyString
public void setCachedResultTypeEmptyString() -
setCachedResultTypeString
public void setCachedResultTypeString() -
setCachedResultErrorCode
public void setCachedResultErrorCode(int errorCode) -
setCachedResultBoolean
public void setCachedResultBoolean(boolean value) -
hasCachedResultString
public boolean hasCachedResultString()- Returns:
trueif thisFormulaRecordis followed by aStringRecordrepresenting the cached text result of the formula evaluation.
-
getCachedResultType
Deprecated.POI 5.0.0, will be removed in 6.0, use getCachedResultTypeEnum until switch to enum is fully done- Returns:
- The type of the cached value or CellType.NUMERIC.getCode() if the cached value is empty
-
getCachedResultTypeEnum
Returns the type of the cached result- Returns:
- The type of the cached value or CellType.NUMERIC if the cached value is empty
- Since:
- POI 5.0.0
-
getCachedBooleanValue
public boolean getCachedBooleanValue() -
getCachedErrorValue
public int getCachedErrorValue() -
setOptions
public void setOptions(short options) set the option flags- Parameters:
options- bitmask
-
getValue
public double getValue()get the calculated value of the formula- Returns:
- calculated value
-
getOptions
public short getOptions()get the option flags- Returns:
- bitmask
-
isAlwaysCalc
public boolean isAlwaysCalc() -
setAlwaysCalc
public void setAlwaysCalc(boolean flag) -
isCalcOnLoad
public boolean isCalcOnLoad() -
setCalcOnLoad
public void setCalcOnLoad(boolean flag) -
getParsedExpression
- Returns:
- the formula tokens. never
null
-
getFormula
-
setParsedExpression
-
getSid
public short getSid()Description copied from class:Recordreturn the non static version of the id for this record. -
copy
- Specified by:
copyin interfaceorg.apache.poi.common.Duplicatable- Specified by:
copyin classCellRecord
-
getGenericRecordType
- Specified by:
getGenericRecordTypein interfaceGenericRecord- Specified by:
getGenericRecordTypein classRecord
-
getGenericProperties
- Specified by:
getGenericPropertiesin interfaceGenericRecord- Overrides:
getGenericPropertiesin classCellRecord
-