AbstractCalculationMonitor

Inheritance: java.lang.Object

public abstract class AbstractCalculationMonitor

Monitor for user to track the progress of formula calculation.

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);

Constructors

ConstructorDescription
AbstractCalculationMonitor()

Methods

MethodDescription
afterCalculate(int sheetIndex, int rowIndex, int colIndex)Implement this method to do business after one cell has been calculated.
beforeCalculate(int sheetIndex, int rowIndex, int colIndex)Implement this method to do business before calculating one cell.
equals(Object arg0)
getCalculatedValue()Gets the newly calculated value of the cell.
getClass()
getOriginalValue()Gets the old value of the calculated cell.
getValueChanged()Whether the cell’s value has been changed after the calculation.
hashCode()
notify()
notifyAll()
onCircular(Iterator circularCellsData)Implement this method to do business when calculating formulas with circular references.
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

AbstractCalculationMonitor()

public AbstractCalculationMonitor()

afterCalculate(int sheetIndex, int rowIndex, int colIndex)

public void afterCalculate(int sheetIndex, int rowIndex, int colIndex)

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

Parameters:

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

beforeCalculate(int sheetIndex, int rowIndex, int colIndex)

public void beforeCalculate(int sheetIndex, int rowIndex, int colIndex)

Implement this method to do business before calculating one cell.

Parameters:

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

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

getCalculatedValue()

public Object getCalculatedValue()

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

Returns: java.lang.Object

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getOriginalValue()

public Object getOriginalValue()

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

Returns: java.lang.Object

getValueChanged()

public boolean getValueChanged()

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

Returns: boolean

hashCode()

public native int hashCode()

Returns: int

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

onCircular(Iterator circularCellsData)

public boolean onCircular(Iterator circularCellsData)

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

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.

Parameters:

ParameterTypeDescription
circularCellsDatajava.util.IteratorIEnumerator with CalculationCell items representing cells that depend on circular references.

Returns: boolean - 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.

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int