public abstract class AbstractCalculationMonitor
extends java.lang.Object
Example
class MyCalculationMonitor extends AbstractCalculationMonitor
{
public /*override*/ void beforeCalculate(int sheetIndex, int rowIndex, int colIndex)
{
if(sheetIndex!=0 || rowIndex!=0 || colIndex!=0)
{
return;
}
System.out.println("Cell A1 will be calculated.");
}
}
Workbook wb = new Workbook("calc.xlsx");
CalculationOptions opts = new CalculationOptions();
opts.setCalculationMonitor(new MyCalculationMonitor());
wb.calculateFormula(opts);
| Constructor and Description |
|---|
AbstractCalculationMonitor() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterCalculate(int sheetIndex,
int rowIndex,
int colIndex)
Implement this method to do business after one cell has been calculated.
|
void |
beforeCalculate(int sheetIndex,
int rowIndex,
int colIndex)
Implement this method to do business before calculating one cell.
|
java.lang.Object |
getCalculatedValue()
Gets the newly calculated value of the cell.
|
java.lang.Object |
getOriginalValue()
Gets the old value of the calculated cell.
|
boolean |
getValueChanged()
Whether the cell's value has been changed after the calculation.
|
boolean |
onCircular(java.util.Iterator circularCellsData)
Implement this method to do business when calculating formulas with circular references.
|
public java.lang.Object getOriginalValue()
beforeCalculate(int,int,int) and afterCalculate(int,int,int).public boolean getValueChanged()
afterCalculate(int,int,int).public java.lang.Object getCalculatedValue()
afterCalculate(int,int,int).public void beforeCalculate(int sheetIndex,
int rowIndex,
int colIndex)
sheetIndex - Index of the sheet that the cell belongs to.rowIndex - Row index of the cellcolIndex - Column index of the cellpublic void afterCalculate(int sheetIndex,
int rowIndex,
int colIndex)
sheetIndex - Index of the sheet that the cell belongs to.rowIndex - Row index of the cellcolIndex - Column index of the cellpublic boolean onCircular(java.util.Iterator circularCellsData)
Remarks
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.circularCellsData - IEnumerator with CalculationCell items representing cells that
depend on circular references.See Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.
We guarantee a prompt response to any inquiry!
© Aspose Pty Ltd 2001-2023. All Rights Reserved.