AbstractFormulaChangeMonitor

Inheritance: java.lang.Object

public abstract class AbstractFormulaChangeMonitor

Monitor for user to track the change of formulas during certain operations.

Remarks

For example, while deleting/inserting range of cells, formulas of other cells may be changed because of the shift of references.

Example

         class MyFormulaChangeMonitor extends AbstractFormulaChangeMonitor
         {
             private final WorksheetCollection mWorksheets;
             public MyFormulaChangeMonitor(WorksheetCollection worksheets)
             {
                 mWorksheets = worksheets;
             }
             public /*override*/ void onCellFormulaChanged(int sheetIndex, int rowIndex, int columnIndex)
             {
                 System.out.println("Cell " + mWorksheets.get(sheetIndex).getName() + "!"
                     + CellsHelper.cellIndexToName(rowIndex, columnIndex)
                     + "'s formula was changed while inserting rows.");
             }
         }
         Workbook wb = new Workbook("template.xlsx");
         InsertOptions options = new InsertOptions();
         options.setFormulaChangeMonitor(new MyFormulaChangeMonitor(wb.getWorksheets()));
         wb.getWorksheets().get(0).getCells().insertRows(0, 2, options);

Constructors

ConstructorDescription
AbstractFormulaChangeMonitor()

Methods

MethodDescription
equals(Object arg0)
getClass()
hashCode()
notify()
notifyAll()
onCellFormulaChanged(int sheetIndex, int rowIndex, int columnIndex)The event that will be triggered when the formula in a cell is changed.
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

AbstractFormulaChangeMonitor()

public AbstractFormulaChangeMonitor()

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

hashCode()

public native int hashCode()

Returns: int

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

onCellFormulaChanged(int sheetIndex, int rowIndex, int columnIndex)

public void onCellFormulaChanged(int sheetIndex, int rowIndex, int columnIndex)

The event that will be triggered when the formula in a cell is changed.

Parameters:

ParameterTypeDescription
sheetIndexintThe sheet index of the changed cell
rowIndexintThe row index of the changed cell
columnIndexintThe column index of the changed cell

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