AbstractCalculationMonitor

AbstractCalculationMonitor class

Monitor for user to track the progress of formula calculation.

Properties

NameTypeDescription
OriginalValueObjectGets the old value of the calculated cell. Should be used only in beforeCalculate(int, int, int) and afterCalculate(int,
ValueChangedbooleanWhether the cell’s value has been changed after the calculation. Should be used only in afterCalculate(int, int, int) .
CalculatedValueObjectGets the newly calculated value of the cell. Should be used only in afterCalculate(int, int, int) .

Methods

NameDescription
beforeCalculateImplement this method to do business before calculating one cell.
afterCalculateImplement this method to do business after one cell has been calculated.
onCircularImplement this method to do business when calculating formulas with circular references.

In the implementation user may |

AbstractCalculationMonitor.OriginalValue property

Gets the old value of the calculated cell. Should be used only in beforeCalculate(int, int, int) and afterCalculate(int, int, int) .

Type: Object

AbstractCalculationMonitor.ValueChanged property

Whether the cell’s value has been changed after the calculation. Should be used only in afterCalculate(int, int, int) .

Type: boolean

AbstractCalculationMonitor.CalculatedValue property

Gets the newly calculated value of the cell. Should be used only in afterCalculate(int, int, int) .

Type: Object

beforeCalculate(sheetIndex, rowIndex, colIndex)

Implement this method to do business before calculating one cell.

ParameterTypeDescription
sheetIndexintIndex of the sheet that the cell belongs to.
rowIndexintRow index of the cell
colIndexintColumn index of the cell

afterCalculate(sheetIndex, rowIndex, colIndex)

Implement this method to do business after one cell has been calculated.

ParameterTypeDescription
sheetIndexintIndex of the sheet that the cell belongs to.
rowIndexintRow index of the cell
colIndexintColumn index of the cell

onCircular(circularCellsData)

Implement this method to do business when calculating formulas with circular references.

In the implementation user may also set the expected value as calculated result for part/all of those cells so the formula engine will not calculate them recursively.

ParameterTypeDescription
circularCellsDataIteratorIEnumerator with CalculationCell items representing cells that depend on circular references.

Returns: Whether the formula engine needs to calculate those cells in circular after this call. True to let the formula engine continue to do calculation for them. False to let the formula engine just mark those cells as Calculated.