public final class ForkedEvaluator
extends java.lang.Object
HSSFWorkbook
or XSSFWorkbook
.
This class enables a 'master workbook' to be loaded just once and shared between many evaluation
clients. Each evaluation client creates its own ForkedEvaluator
and can set cell values
that will be used for local evaluations (and don't disturb evaluations on other evaluators).Modifier and Type | Method and Description |
---|---|
void |
copyUpdatedCells(Workbook workbook)
Copies the values of all updated cells (modified by calls to
updateCell(String, int, int, ValueEval) ) to the supplied workbook.Typically, the supplied workbook is a writable copy of the 'master workbook', but at the very least it must contain sheets with the same names. |
static ForkedEvaluator |
create(Workbook wb,
IStabilityClassifier stabilityClassifier,
UDFFinder udfFinder) |
ValueEval |
evaluate(java.lang.String sheetName,
int rowIndex,
int columnIndex)
If cell contains a formula, the formula is evaluated and returned,
else the CellValue simply copies the appropriate cell value from
the cell and also its cell type.
|
static void |
setupEnvironment(java.lang.String[] workbookNames,
ForkedEvaluator[] evaluators)
Coordinates several formula evaluators together so that formulas that involve external
references can be evaluated.
|
void |
updateCell(java.lang.String sheetName,
int rowIndex,
int columnIndex,
ValueEval value)
Sets the specified cell to the supplied value
|
public static ForkedEvaluator create(Workbook wb, IStabilityClassifier stabilityClassifier, UDFFinder udfFinder)
udfFinder
- pass null
for default (AnalysisToolPak only)public void updateCell(java.lang.String sheetName, int rowIndex, int columnIndex, ValueEval value)
sheetName
- the name of the sheet containing the cellrowIndex
- zero basedcolumnIndex
- zero basedpublic void copyUpdatedCells(Workbook workbook)
updateCell(String, int, int, ValueEval)
) to the supplied workbook.public ValueEval evaluate(java.lang.String sheetName, int rowIndex, int columnIndex)
sheetName
- the name of the sheet containing the cellrowIndex
- zero basedcolumnIndex
- zero basednull
if the supplied cell is null
or blankpublic static void setupEnvironment(java.lang.String[] workbookNames, ForkedEvaluator[] evaluators)
workbookNames
- the simple file names used to identify the workbooks in formulas
with external links (for example "MyData.xls" as used in a formula "[MyData.xls]Sheet1!A1")evaluators
- all evaluators for the full set of workbooks required by the formulas.Copyright 2021 The Apache Software Foundation or its licensors, as applicable.