org.apache.poi.ss.util
Class SSCellRange
java.lang.Object
org.apache.poi.ss.util.SSCellRange
- All Implemented Interfaces:
- CellRange, Iterable
public final class SSCellRange
- extends java.lang.Object
- implements CellRange
For POI internal use only
- Author:
- Josh Micich
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
create
public static SSCellRange create(int firstRow,
int firstColumn,
int height,
int width,
java.util.List flattenedList,
java.lang.Class cellClass)
getHeight
public int getHeight()
- Specified by:
getHeight
in interface CellRange
getWidth
public int getWidth()
- Specified by:
getWidth
in interface CellRange
size
public int size()
- Description copied from interface:
CellRange
- Gets the number of cells in this range.
- Specified by:
size
in interface CellRange
- Returns:
- height * width
getReferenceText
public java.lang.String getReferenceText()
- Specified by:
getReferenceText
in interface CellRange
getTopLeftCell
public java.lang.Object getTopLeftCell()
- Specified by:
getTopLeftCell
in interface CellRange
- Returns:
- the cell at relative coordinates (0,0). Never
null
.
getCell
public java.lang.Object getCell(int relativeRowIndex,
int relativeColumnIndex)
- Specified by:
getCell
in interface CellRange
- Parameters:
relativeRowIndex
- must be between 0 and height-1relativeColumnIndex
- must be between 0 and width-1
- Returns:
- the cell at the specified coordinates. Never
null
.
getFlattenedCells
public java.lang.Object[] getFlattenedCells()
- Specified by:
getFlattenedCells
in interface CellRange
- Returns:
- a flattened array of all the cells in this
CellRange
getCells
public java.lang.Object[][] getCells()
- Specified by:
getCells
in interface CellRange
- 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 (values 0...width-1)
iterator
public java.util.Iterator iterator()
- Specified by:
iterator
in interface CellRange
- Specified by:
iterator
in interface Iterable
- Returns:
- an
Iterator
over all cells in this range. Iteration starts
with all cells in the first row followed by all cells in the next row, etc.