Top Description Fields Constructors Methods
org.apache.poi.ss.formula

pack-priv final Class EvaluationTracker

extends Object
Class Inheritance
Imports
java.util.ArrayList, .HashSet, .List, .Set, org.apache.poi.ss.formula.eval.BlankEval, .ErrorEval, .ValueEval

Instances of this class keep track of multiple dependent cell evaluations due to recursive calls to WorkbookEvaluator#evaluate(EvaluationCell)} The main purpose of this class is to detect an attempt to evaluate a cell that is already being evaluated. In other words, it detects circular references in spreadsheet formulas.

Field Summary

Modifier and TypeField and Description
private final EvaluationCache
private final Set<FormulaCellCacheEntry>
private final List<CellEvaluationFrame>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public void
acceptPlainValueDependency(EvaluationWorkbook evalWorkbook, int bookIndex, int sheetIndex, int rowIndex, int columnIndex, ValueEval value)

public void
endEvaluate(CellCacheEntry cce)

Notifies this evaluation tracker that the evaluation of the specified cell is complete.

public boolean

Returns:

false if the specified cell is already being evaluated
startEvaluate
(FormulaCellCacheEntry cce)

Notifies this evaluation tracker that evaluation of the specified cell is about to start.

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_cacheback to summary
private final EvaluationCache _cache
_currentlyEvaluatingCellsback to summary
private final Set<FormulaCellCacheEntry> _currentlyEvaluatingCells
_evaluationFramesback to summary
private final List<CellEvaluationFrame> _evaluationFrames

Constructor Detail

EvaluationTrackerback to summary
public EvaluationTracker(EvaluationCache cache)

Method Detail

acceptFormulaDependencyback to summary
public void acceptFormulaDependency(CellCacheEntry cce)
acceptPlainValueDependencyback to summary
public void acceptPlainValueDependency(EvaluationWorkbook evalWorkbook, int bookIndex, int sheetIndex, int rowIndex, int columnIndex, ValueEval value)
endEvaluateback to summary
public void endEvaluate(CellCacheEntry cce)

Notifies this evaluation tracker that the evaluation of the specified cell is complete.

Every successful call to startEvaluate must be followed by a call to endEvaluate (recommended in a finally block) to enable proper tracking of which cells are being evaluated at any point in time.

Assuming a well behaved client, parameters to this method would not be required. However, they have been included to assert correct behaviour, and form more meaningful error messages.

startEvaluateback to summary
public boolean startEvaluate(FormulaCellCacheEntry cce)

Notifies this evaluation tracker that evaluation of the specified cell is about to start.
In the case of a true return code, the caller should continue evaluation of the specified cell, and also be sure to call endEvaluate() when complete.
In the case of a null return code, the caller should return an evaluation result of ErrorEval.CIRCULAR_REF_ERROR, and not call endEvaluate().

Returns:boolean

false if the specified cell is already being evaluated

updateCacheResultback to summary
public void updateCacheResult(ValueEval result)