Package org.apache.poi.xssf.usermodel
Class XSSFFormulaEvaluator
- java.lang.Object
-
- org.apache.poi.ss.formula.BaseFormulaEvaluator
-
- org.apache.poi.xssf.usermodel.BaseXSSFFormulaEvaluator
-
- org.apache.poi.xssf.usermodel.XSSFFormulaEvaluator
-
- All Implemented Interfaces:
WorkbookEvaluatorProvider,FormulaEvaluator
public final class XSSFFormulaEvaluator extends BaseXSSFFormulaEvaluator
Evaluates formula cells.For performance reasons, this class keeps a cache of all previously calculated intermediate cell values. Be sure to call
BaseFormulaEvaluator.clearAllCachedResultValues()if any workbook cells are changed between calls to evaluate~ methods on this class.
-
-
Field Summary
-
Fields inherited from class org.apache.poi.ss.formula.BaseFormulaEvaluator
_bookEvaluator
-
-
Constructor Summary
Constructors Modifier Constructor Description XSSFFormulaEvaluator(XSSFWorkbook workbook)protectedXSSFFormulaEvaluator(XSSFWorkbook workbook, WorkbookEvaluator bookEvaluator)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static XSSFFormulaEvaluatorcreate(XSSFWorkbook workbook, IStabilityClassifier stabilityClassifier, UDFFinder udfFinder)voidevaluateAll()Loops over all cells in all sheets of the supplied workbook.static voidevaluateAllFormulaCells(XSSFWorkbook wb)Loops over all cells in all sheets of the supplied workbook.XSSFCellevaluateInCell(Cell cell)voidnotifyDeleteCell(Cell cell)voidnotifySetFormula(Cell cell)voidnotifyUpdateCell(Cell cell)protected EvaluationCelltoEvaluationCell(Cell cell)Turns a XSSFCell into a XSSFEvaluationCell-
Methods inherited from class org.apache.poi.xssf.usermodel.BaseXSSFFormulaEvaluator
createRichTextString, evaluateFormulaCellValue, setCellType
-
Methods inherited from class org.apache.poi.ss.formula.BaseFormulaEvaluator
_getWorkbookEvaluator, clearAllCachedResultValues, evaluate, evaluateAllFormulaCells, evaluateAllFormulaCells, evaluateFormulaCell, getEvaluationWorkbook, setCellType, setCellValue, setDebugEvaluationOutputForNextEval, setIgnoreMissingWorkbooks, setupEnvironment, setupReferencedWorkbooks
-
-
-
-
Constructor Detail
-
XSSFFormulaEvaluator
public XSSFFormulaEvaluator(XSSFWorkbook workbook)
-
XSSFFormulaEvaluator
protected XSSFFormulaEvaluator(XSSFWorkbook workbook, WorkbookEvaluator bookEvaluator)
-
-
Method Detail
-
create
public static XSSFFormulaEvaluator create(XSSFWorkbook workbook, IStabilityClassifier stabilityClassifier, UDFFinder udfFinder)
- Parameters:
stabilityClassifier- used to optimise caching performance. Passnullfor the (conservative) assumption that any cell may have its definition changed after evaluation begins.udfFinder- passnullfor default (AnalysisToolPak only)
-
notifySetFormula
public void notifySetFormula(Cell cell)
-
notifyDeleteCell
public void notifyDeleteCell(Cell cell)
-
notifyUpdateCell
public void notifyUpdateCell(Cell cell)
-
evaluateAllFormulaCells
public static void evaluateAllFormulaCells(XSSFWorkbook wb)
Loops over all cells in all sheets of the supplied workbook. For cells that contain formulas, their formulas are evaluated, and the results are saved. These cells remain as formula cells. For cells that do not contain formulas, no changes are made. This is a helpful wrapper around looping over all cells, and calling evaluateFormulaCell on each one.
-
evaluateInCell
public XSSFCell evaluateInCell(Cell cell)
- Specified by:
evaluateInCellin interfaceFormulaEvaluator- Overrides:
evaluateInCellin classBaseFormulaEvaluator
-
evaluateAll
public void evaluateAll()
Loops over all cells in all sheets of the supplied workbook. For cells that contain formulas, their formulas are evaluated, and the results are saved. These cells remain as formula cells. For cells that do not contain formulas, no changes are made. This is a helpful wrapper around looping over all cells, and calling evaluateFormulaCell on each one.
-
toEvaluationCell
protected EvaluationCell toEvaluationCell(Cell cell)
Turns a XSSFCell into a XSSFEvaluationCell- Specified by:
toEvaluationCellin classBaseXSSFFormulaEvaluator
-
-