Home  Products  Purchase  Downloads  Demos  Forums  Blogs  Ticket  Wiki  API  Corporate


com.aspose.cells
Interface CellHandler


public interface CellHandler

Handler for processing cell values in Excel file cell by cell in Event driven mode. When the LightCells encounter one sheet, such as in LightCells.processWorkbook(CellHandler), or when user call LightCells.processWorksheet(int, CellHandler) or LightCells.processWorksheet(String, CellHandler), LightCells will call startSheet(int) first to check whether this sheet should be precessed. If true returned, then will check and process all cells in this sheet; if false returned, will ignore this sheet and move to next one. When encounter one cell, LightCells will call startCell(int, int) first to check whether this cell needs to be processed. If true returned, then will parse the cell's value and call process(LightCell); if false returned, will ignore this cell and move to next cell.


Method Summary
 void process(LightCell cell)
          process current cell.
Note: In consideration of performance, the LightCell object and the object field of it maybe reused for all cells, if it is needed to use current cell's data later out of current processing scope, the implementation should create one copy of current cell's data by LightCell.copy() and keep the cloned one for later using.
 boolean startCell(int row, int column)
          start with a cell, check whether process it.
 boolean startSheet(int sheetIndex)
          start with a worksheet, check whether process it.
 

Method Detail

startSheet

boolean startSheet(int sheetIndex)
start with a worksheet, check whether process it. If this handler need to refer to sheetIndex later in startCell() or process() method, that is, if the process need to know which worksheet is being processed, the implementation should retain the sheetIndex value here.

Parameters:
sheetIndex - index of current sheet.
Returns:
true if given sheet should be processed; false if given sheet should be ignored.

startCell

boolean startCell(int row,
                  int column)
start with a cell, check whether process it.

Parameters:
row - row index of current cell, base 0
column - column index of current cell, base 0
Returns:
true will call process(LightCell) on this cell. false will ignore this cell and move to next one.

process

void process(LightCell cell)
process current cell.
Note: In consideration of performance, the LightCell object and the object field of it maybe reused for all cells, if it is needed to use current cell's data later out of current processing scope, the implementation should create one copy of current cell's data by LightCell.copy() and keep the cloned one for later using.

Parameters:
cell - data of current cell.