Class PrometheusSheetView
java.lang.Object
io.github.tonywasher.joceanus.prometheus.service.sheet.PrometheusSheetView
Represents a view of a range of cells.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPrometheusSheetView(PrometheusSheetCell pFirstCell, PrometheusSheetCell pLastCell) Constructor.PrometheusSheetView(PrometheusSheetSheet pSheet, PrometheusSheetCellPosition pFirstCell, PrometheusSheetCellPosition pLastCell) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionObtain a cell iterator for non-empty cells in the view and in the row.protected intconvertRowIndex(int pRowIndex) Convert Row index.Obtain the top left position.getCellByPosition(int pColumnIndex, int pRowIndex) Obtain the cell at required position.getCellByPosition(PrometheusSheetCellPosition pPosition) Obtain the cell at required position.intDetermine number of columns in this view.getRowByIndex(int pRowIndex) Obtain the row at required index.getRowCellByIndex(PrometheusSheetRow pRow, int pIndex) Obtain the cell at required index.intDetermine number of rows in this view.getSheet()Obtain the underlying sheet.Obtain a row iterator for non-empty rows in this view.
-
Constructor Details
-
PrometheusSheetView
public PrometheusSheetView(PrometheusSheetSheet pSheet, PrometheusSheetCellPosition pFirstCell, PrometheusSheetCellPosition pLastCell) Constructor.- Parameters:
pSheet- the sheet containing the viewpFirstCell- the first cell of the viewpLastCell- the last cell of the view
-
PrometheusSheetView
Constructor.- Parameters:
pFirstCell- the first cell of the viewpLastCell- the last cell of the view
-
-
Method Details
-
getSheet
Obtain the underlying sheet.- Returns:
- the underlying sheet
-
getBaseCell
Obtain the top left position.- Returns:
- the top left position
-
getRowCount
public int getRowCount()Determine number of rows in this view.- Returns:
- the number of rows.
-
getColumnCount
public int getColumnCount()Determine number of columns in this view.- Returns:
- the number of columns.
-
convertRowIndex
protected int convertRowIndex(int pRowIndex) Convert Row index.- Parameters:
pRowIndex- the view index- Returns:
- the sheet index or -1 if outside view
-
getRowByIndex
Obtain the row at required index.- Parameters:
pRowIndex- the requested row index- Returns:
- the requested row.
-
getCellByPosition
Obtain the cell at required position.- Parameters:
pColumnIndex- the requested column indexpRowIndex- the requested row index- Returns:
- the requested cell.
-
getCellByPosition
Obtain the cell at required position.- Parameters:
pPosition- the requested position- Returns:
- the requested cell.
-
getRowCellByIndex
Obtain the cell at required index.- Parameters:
pRow- the row to extract frompIndex- the requested index- Returns:
- the requested cell.
-
cellIterator
Obtain a cell iterator for non-empty cells in the view and in the row.- Parameters:
pRow- the row- Returns:
- the iterator
-
rowIterator
Obtain a row iterator for non-empty rows in this view.- Returns:
- the iterator
-