public final class WorkbookEvaluator extends Object
clearAllCachedResultValues()
if any workbook cells are changed between
calls to evaluate~ methods on this class.Modifier and Type | Class and Description |
---|---|
static interface |
WorkbookEvaluator.CacheManager |
Constructor and Description |
---|
WorkbookEvaluator(EvaluationWorkbook workbook,
IStabilityClassifier stabilityClassifier,
UDFFinder udfFinder) |
WorkbookEvaluator(EvaluationWorkbook workbook,
IStabilityClassifier stabilityClassifier,
UDFFinder udfFinder,
WorkbookEvaluator.CacheManager cacheManager) |
Modifier and Type | Method and Description |
---|---|
void |
clearAllCachedResultValues()
Should be called whenever there are changes to input cells in the evaluated workbook.
|
void |
clearColumnCache(int sheetIndex,
int start,
int end) |
static ValueEval |
dereferenceResult(ValueEval evaluationResult,
int srcRowNum,
int srcColNum)
Dereferences a single value from any AreaEval or RefEval evaluation
result.
|
ValueEval |
evaluate(EvaluationCell srcCell,
Object ref) |
ValueEval |
evaluate(EvaluationCell srcCell,
Object ref,
int[] offset) |
ValueEval |
evaluate(int sheetIndex,
int rowIndex,
int columnIndex,
String formula,
boolean ignoreDereference,
Object ref,
int[] offset) |
ValueEval |
evaluate(int sheetIndex,
String formula,
boolean ignoreDereference,
Object ref) |
ValueEval |
evaluate(int sheetIndex,
String formula,
boolean ignoreDereference,
Object ref,
int[] offset)
Deprecated.
|
ValueEval |
evaluatePtgs(int sheetIndex,
Ptg[] tokens,
boolean ignoreDereference,
Object ref) |
ValueEval |
evaluatePtgs(int sheetIndex,
Ptg[] tokens,
boolean ignoreDereference,
Object ref,
int[] offset) |
FreeRefFunction |
findUserDefinedFunction(String functionName) |
static Collection<String> |
getNotSupportedFunctionNames()
Return a collection of functions that POI does not support
|
static Collection<String> |
getSupportedFunctionNames()
Return a collection of functions that POI can evaluate
|
void |
notifyDeleteCell(EvaluationCell cell)
Should be called to tell the cell value cache that the specified cell has just been
deleted.
|
void |
notifyUpdateCell(EvaluationCell cell)
Should be called to tell the cell value cache that the specified (value or formula) cell
has changed.
|
static void |
registerFunction(String name,
FreeRefFunction func)
Register a ATP function in runtime.
|
static void |
registerFunction(String name,
Function func)
Register a function in runtime.
|
void |
setDebugEvaluationOutputForNextEval(boolean value) |
void |
setDependencyTracker(DependencyTracker tracker) |
void |
setIgnoreMissingWorkbooks(boolean ignore)
Whether to ignore missing references to external workbooks and
use cached formula results in the main workbook instead.
|
public WorkbookEvaluator(EvaluationWorkbook workbook, IStabilityClassifier stabilityClassifier, UDFFinder udfFinder)
udfFinder
- pass null
for default (AnalysisToolPak only)public WorkbookEvaluator(EvaluationWorkbook workbook, IStabilityClassifier stabilityClassifier, UDFFinder udfFinder, WorkbookEvaluator.CacheManager cacheManager)
public void setDependencyTracker(DependencyTracker tracker)
public void clearAllCachedResultValues()
public void notifyUpdateCell(EvaluationCell cell)
public void notifyDeleteCell(EvaluationCell cell)
public void clearColumnCache(int sheetIndex, int start, int end)
public ValueEval evaluate(EvaluationCell srcCell, Object ref)
public ValueEval evaluate(EvaluationCell srcCell, Object ref, int[] offset)
public static ValueEval dereferenceResult(ValueEval evaluationResult, int srcRowNum, int srcColNum)
NumberEval
, StringEval
, BoolEval
, or
ErrorEval
. Never null
. BlankEval
is
converted to NumberEval.ZERO
public FreeRefFunction findUserDefinedFunction(String functionName)
public void setIgnoreMissingWorkbooks(boolean ignore)
In some cases external workbooks referenced by formulas in the main workbook are not avaiable. With this method you can control how POI handles such missing references:
CollaboratingWorkbooksEnvironment.WorkbookNotFoundException
if an external reference cannot be resolvedignore
- whether to ignore missing references to external workbookspublic static Collection<String> getSupportedFunctionNames()
public static Collection<String> getNotSupportedFunctionNames()
public static void registerFunction(String name, FreeRefFunction func)
name
- the function namefunc
- the functoin to registerIllegalArgumentException
- if the function is unknown or already registered.public static void registerFunction(String name, Function func)
name
- the function namefunc
- the functoin to registerIllegalArgumentException
- if the function is unknown or already registered.public ValueEval evaluate(int sheetIndex, String formula, boolean ignoreDereference, Object ref)
@Deprecated public ValueEval evaluate(int sheetIndex, String formula, boolean ignoreDereference, Object ref, int[] offset)
public ValueEval evaluate(int sheetIndex, int rowIndex, int columnIndex, String formula, boolean ignoreDereference, Object ref, int[] offset)
public void setDebugEvaluationOutputForNextEval(boolean value)
public ValueEval evaluatePtgs(int sheetIndex, Ptg[] tokens, boolean ignoreDereference, Object ref)
Copyright © 2020. All rights reserved.