Package org.apache.poi.ss.usermodel
Interface CellRange<C extends Cell>
-
- All Superinterfaces:
Iterable<C>
- All Known Implementing Classes:
SSCellRange
public interface CellRange<C extends Cell> extends Iterable<C>
Represents a rectangular region of aSheet
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CgetCell(int relativeRowIndex, int relativeColumnIndex)C[][]getCells()C[]getFlattenedCells()intgetHeight()StringgetReferenceText()CgetTopLeftCell()intgetWidth()Iterator<C>iterator()intsize()Gets the number of cells in this range.-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
getWidth
int getWidth()
-
getHeight
int getHeight()
-
size
int size()
Gets the number of cells in this range.- Returns:
height * width
-
getReferenceText
String getReferenceText()
- Returns:
- the text format of this range. Single cell ranges are formatted like single cell references (e.g. 'A1' instead of 'A1:A1').
-
getTopLeftCell
C getTopLeftCell()
- Returns:
- the cell at relative coordinates (0,0). Never
null.
-
getCell
C getCell(int relativeRowIndex, int relativeColumnIndex)
- Parameters:
relativeRowIndex- must be between0andheight-1relativeColumnIndex- must be between0andwidth-1- Returns:
- the cell at the specified coordinates. Never
null.
-
getFlattenedCells
C[] getFlattenedCells()
- Returns:
- a flattened array of all the cells in this CellRange
-
getCells
C[][] getCells()
- Returns:
- a 2-D array of all the cells in this CellRange. The first
array dimension is the row index (values
0...height-1) and the second dimension is the column index (values0...width-1)
-
-