Class PrometheusSheetSheet
java.lang.Object
io.github.tonywasher.joceanus.prometheus.service.sheet.PrometheusSheetSheet
Class representing a sheet within a workBook.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPrometheusSheetSheet(PrometheusSheetWorkBook pWorkBook, String pName, boolean pReadOnly) Constructor for Excel Sheet. -
Method Summary
Modifier and TypeMethodDescriptionabstract voidapplyDataFilter(PrometheusSheetCellPosition pBaseCell, int pNumRows) Apply data validation to a range of cells.abstract voidapplyDataValidation(PrometheusSheetCellPosition pFirstCell, PrometheusSheetCellPosition pLastCell, String pName) Apply data validation to a range of cells.abstract voidcreateFreezePane(PrometheusSheetCellPosition pFreezeCell) Create freeze panes.voiddeclareRange(String pName, PrometheusSheetCellPosition pSingleCell) Name a single cell as a range.abstract voiddeclareRange(String pName, PrometheusSheetCellPosition pFirstCell, PrometheusSheetCellPosition pLastCell) Name a range.abstract PrometheusSheetColumngetMutableColumnByIndex(int pColIndex) Obtain the column by index, creating column if it does not exist.abstract PrometheusSheetRowgetMutableRowByIndex(int pRowIndex) Obtain the row at required index within the sheet, create it if it does not exist.getName()Obtain the name of the sheet.abstract PrometheusSheetColumngetReadOnlyColumnByIndex(int pColIndex) Obtain the column by index.abstract PrometheusSheetRowgetReadOnlyRowByIndex(int pRowIndex) Obtain the row at required index within the sheet, if it exists.abstract intGet row count.abstract intGet sheet index.Obtain the workBook.abstract booleanisHidden()Is the sheet hidden?booleanIs the sheet readOnly?protected abstract ListIterator<PrometheusSheetRow> iteratorForRange(int pFirstIndex, int pLastIndex) Obtain an iterator of non-null rows for the view.abstract voidsetHidden(boolean isHidden) Set sheet hidden status.
-
Constructor Details
-
PrometheusSheetSheet
Constructor for Excel Sheet.- Parameters:
pWorkBook- the workBookpName- the sheet namepReadOnly- is the sheet readOnly?
-
-
Method Details
-
getWorkBook
Obtain the workBook.- Returns:
- the workBook
-
getName
Obtain the name of the sheet.- Returns:
- the name
-
getSheetIndex
public abstract int getSheetIndex()Get sheet index.- Returns:
- the index of the sheet
-
isReadOnly
public boolean isReadOnly()Is the sheet readOnly?- Returns:
- true/false
-
isHidden
public abstract boolean isHidden()Is the sheet hidden?- Returns:
- true/false
-
setHidden
public abstract void setHidden(boolean isHidden) Set sheet hidden status.- Parameters:
isHidden- true/false
-
getRowCount
public abstract int getRowCount()Get row count.- Returns:
- the count of rows
-
getReadOnlyRowByIndex
Obtain the row at required index within the sheet, if it exists.- Parameters:
pRowIndex- the requested row index- Returns:
- the requested row.
-
getMutableRowByIndex
Obtain the row at required index within the sheet, create it if it does not exist.- Parameters:
pRowIndex- the requested row index- Returns:
- the requested row.
-
getReadOnlyColumnByIndex
Obtain the column by index.- Parameters:
pColIndex- the column index- Returns:
- the column
-
getMutableColumnByIndex
Obtain the column by index, creating column if it does not exist.- Parameters:
pColIndex- the column index- Returns:
- the column
-
declareRange
public abstract void declareRange(String pName, PrometheusSheetCellPosition pFirstCell, PrometheusSheetCellPosition pLastCell) throws OceanusException Name a range.- Parameters:
pName- the name of the rangepFirstCell- the first cell in the rangepLastCell- the last cell in the range- Throws:
OceanusException- on error
-
declareRange
public void declareRange(String pName, PrometheusSheetCellPosition pSingleCell) throws OceanusException Name a single cell as a range.- Parameters:
pName- the name of the rangepSingleCell- the cell to name- Throws:
OceanusException- on error
-
applyDataValidation
public abstract void applyDataValidation(PrometheusSheetCellPosition pFirstCell, PrometheusSheetCellPosition pLastCell, String pName) throws OceanusException Apply data validation to a range of cells.- Parameters:
pFirstCell- the first cell in the rangepLastCell- the last cell in the rangepName- the name of the validation range list- Throws:
OceanusException- on error
-
applyDataFilter
public abstract void applyDataFilter(PrometheusSheetCellPosition pBaseCell, int pNumRows) throws OceanusException Apply data validation to a range of cells.- Parameters:
pBaseCell- the first cell in the rangepNumRows- the number of rows in the filter- Throws:
OceanusException- on error
-
createFreezePane
Create freeze panes.- Parameters:
pFreezeCell- the cell to freeze at
-
iteratorForRange
protected abstract ListIterator<PrometheusSheetRow> iteratorForRange(int pFirstIndex, int pLastIndex) Obtain an iterator of non-null rows for the view.- Parameters:
pFirstIndex- the first row in the viewpLastIndex- the last row in the view- Returns:
- the iterator
-