Package org.jzy3d.io.xls
Class ExcelBuilderMultiSheet
- java.lang.Object
-
- org.jzy3d.io.xls.ExcelBuilder
-
- org.jzy3d.io.xls.ExcelBuilderMultiSheet
-
- All Implemented Interfaces:
IExcelBuilder
public class ExcelBuilderMultiSheet extends ExcelBuilder
Override the defaultExcelBuilder
to write over several excel sheet once a cell column exceeds the maximum number of column for excel.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jzy3d.io.xls.ExcelBuilder
ExcelBuilder.Type
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
multiSheetMode
-
Fields inherited from class org.jzy3d.io.xls.ExcelBuilder
boldFont, CRASH_ON_CELL_OVERFLOW, create, currentSheetId, drawing, LAST_COLUMN, LAST_ROW, MAX_COLUMN, MAX_ROW, sheets, type, workbook
-
-
Constructor Summary
Constructors Constructor Description ExcelBuilderMultiSheet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
autoSelectSheet(int column)
Compute the sheet/column required to access the given column.org.apache.poi.ss.usermodel.Cell
getOrCreateCell(int i, int j)
int
getVirtualCellColumn(int realColumn)
Return a column ID for the expected cell: returns 255 for realColumn=255 returns 0 for realColumn=256 ...int
getVirtualCellSheet(int realColumn)
Return a sheet ID for the expected cell: sheet 0 for cells [0;255] sheet 1 for cells [256;511] ...boolean
isMultiSheetColumns()
void
setMultiSheetColumns(boolean multiSheetMode)
If true, the builder is able to switch on next sheets to fill cells with column id > 255.protected boolean
validateCellIndex(int row, int column, String content)
Only invalidate cells having a too large row id.-
Methods inherited from class org.jzy3d.io.xls.ExcelBuilder
addComment, buildComment, getAllSheetNames, getAllSheets, getBoldFont, getCell, getColor, getColor, getCreationHelper, getCurrentSheet, getCurrentSheetId, getHSSFWorkbook, getOrCreateRow, getSheet, getWorkbook, getXSSFWorkbook, load, load, loadPicture, loadStyleSheet, mergeRange, newCellStyle, newColoredCellStyle, newColoredCellStyle, newFont, newSheet, newSheet, save, save, setActiveSheet, setCell, setCell, setCell, setCell, setCellFormula, setColumnWidth, setColumnWidthAuto, setCurrentSheet, setCurrentSheet, setCurrentSheetId, setFreezePane, setFreezePane, setHyperlink, setPicture, setRowHeight, setSheetOrder, setSplitPane, sheetInitialized
-
-
-
-
Method Detail
-
isMultiSheetColumns
public boolean isMultiSheetColumns()
-
setMultiSheetColumns
public void setMultiSheetColumns(boolean multiSheetMode)
If true, the builder is able to switch on next sheets to fill cells with column id > 255.
-
getOrCreateCell
public org.apache.poi.ss.usermodel.Cell getOrCreateCell(int i, int j)
- Overrides:
getOrCreateCell
in classExcelBuilder
-
validateCellIndex
protected boolean validateCellIndex(int row, int column, String content)
Only invalidate cells having a too large row id. Validate a cell index. If cell index is out of maximum number of rows/columns:- throws an
IllegalArgumentException
ifExcelBuilder.CRASH_ON_CELL_OVERFLOW
is set to true. - otherwise emit a log warning and return false to invalidate this cell.
- Overrides:
validateCellIndex
in classExcelBuilder
- throws an
-
getVirtualCellSheet
public int getVirtualCellSheet(int realColumn)
Return a sheet ID for the expected cell:- sheet 0 for cells [0;255]
- sheet 1 for cells [256;511]
- ...
-
getVirtualCellColumn
public int getVirtualCellColumn(int realColumn)
Return a column ID for the expected cell:- returns 255 for realColumn=255
- returns 0 for realColumn=256
- ...
-
autoSelectSheet
protected int autoSelectSheet(int column)
Compute the sheet/column required to access the given column. If expected sheet is not current, change it. If it does not exist, create it.- Returns:
- an updated column index.
-
-