|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.poi.ss.formula.eval.forked.ForkedEvaluator
public final class ForkedEvaluator
An alternative workbook evaluator that saves memory in situations where a single workbook is
concurrently and independently evaluated many times. With standard formula evaluation, around
90% of memory consumption is due to loading of the 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).
Method Summary | |
---|---|
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
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 based
null
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |