All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.aspose.cells.LightCellsDataProvider.html Maven / Gradle / Ivy






LightCellsDataProvider




com.aspose.cells
Interface LightCellsDataProvider


public interface LightCellsDataProvider 

Represents Data provider for saving large spreadsheet files in light weight mode. When saving a workbook by this mode, startSheet(int) will be checked when saving every worksheet in the workbook. For one sheet, if startSheet(int) gives true, then all data and properties of rows/cells of this sheet to be saved will be provided by the implementation of this interface. In the first place, nextRow() will be called to get the next row index to be saved. If a valid row index is returned(the row index must be in ascending order for the rows to be saved), then a Row object representing this row will be provided for implementation to set its properties by startRow(com.aspose.cells.Row). For one row, nextCell() will be checked firstly. If a valid column index be returned(the column index must be in ascending order for all cells of one row to be saved), then a Cell object representing this cell will be provided for implementation to set its data and properties by startCell(com.aspose.cells.Cell). After data of this cell is set, this cell will be saved directly to the generated spreadsheet file and the next cell will be checked and processed.


Method Summary
abstract booleanisGatherString()
           Checks whether the current string value of cell needs to be gathered into a global pool.
abstract intnextCell()
           Gets next cell to be saved.
abstract intnextRow()
           Gets the next row to be saved.
abstract voidstartCell(Cell cell)
           Starts to save data of one cell.
abstract voidstartRow(Row row)
           Starts to save data of one row.
abstract booleanstartSheet(int sheetIndex)
           Starts to save a worksheet.
 

Method Detail

startSheet

public abstract boolean startSheet(int sheetIndex)
Starts to save a worksheet. It will be called at the beginning of saving a worksheet during saving a workbook. If the provider needs to refer to
sheetIndex
later in startRow(Row) or startCell(Cell) method, that is, if the process needs to know which worksheet is being processed, the implementation should retain the
sheetIndex
value here.
Parameters:
sheetIndex - index of current sheet to be saved.
Returns:
true if this provider will provide data for the given sheet; false if given sheet should use its normal data model(Cells).

nextRow

public abstract int nextRow()
Gets the next row to be saved. It will be called at the beginning of saving a row and its cells data(before startRow(com.aspose.cells.Row)).
Returns:
the next row index to be saved. -1 means the end of current sheet data has been reached and no further row of current sheet to be saved.

startRow

public abstract void startRow(Row row)
Starts to save data of one row. It will be called at the beginning of saving a row and its cells data. If current row has some custom properties such as height, style, ...etc., implementation should set those properties to given Row object here.
Parameters:
row - Row object for implementation to fill data. Its row index is the returned value of latest call of nextRow(). If the row has been initialized in the inner cells model, the existing row object will be used. Otherwise a temporary Row object will be used for implementation to fill data.

nextCell

public abstract int nextCell()
Gets next cell to be saved. It will be called at the beginning of saving one cell.
Returns:
column index of the next cell to be saved. -1 means the end of current row data has been reached and no further cell of current row to be saved.

startCell

public abstract void startCell(Cell cell)
Starts to save data of one cell.
Parameters:
cell - Cell object for implementation to fill data. Its column index is the returned value of latest call of nextCell(). If the cell has been initialized in the inner cells model, the existed cell object will be used. Otherwise a temporary Cell object will be used for implementation to fill data.

isGatherString

public abstract boolean isGatherString()
Checks whether the current string value of cell needs to be gathered into a global pool. Gathering string values will take advantage only when there are many duplicated string values for the cells provided by this implementation. In this situation gathering string will save much memory and generate smaller resultant file. If there are many string values for the cells provided by LightCellsDataProvider but few of them are same, gathering string will cost more memory and time and has no advantage for the resultant file.
Returns:
true if string value need to be gathered into a global pool for the resultant file.

See Also:
          Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
          Aspose.Cells Support Forum - our preferred method of support.





© 2015 - 2024 Weber Informatics LLC | Privacy Policy