Top Description Methods
org.apache.poi.ss.usermodel

public Interface CellRange<C extends Cell>

extends Iterable<C extends Cell>
Known Direct Implementers
org.apache.poi.ss.util.SSCellRange
Imports
java.util.Iterator

Represents a rectangular region of a Sheet

Method Summary

Modifier and TypeMethod and Description
public C

Returns:

the cell at the specified coordinates. Never null.
getCell
(int
must be between 0 and height-1
relativeRowIndex
,
int
must be between 0 and width-1
relativeColumnIndex
)

public C[][]

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)
getCells
()

public C[]

Returns:

a flattened array of all the cells in this CellRange
getFlattenedCells
()

public int
public String

Returns:

the text format of this range. Single cell ranges are formatted like single cell references (e.g. 'A1' instead of 'A1:A1').
getReferenceText
()

public C

Returns:

the cell at relative coordinates (0,0). Never null.
getTopLeftCell
()

public int
public Iterator<C>

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.
iterator
()

Redeclares java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

public int

Returns:

height * width
size
()

Gets the number of cells in this range.

Inherited from java.lang.Iterable:
forEachspliterator

Method Detail

getCellback to summary
public C getCell(int relativeRowIndex, int relativeColumnIndex)
Parameters
relativeRowIndex:int

must be between 0 and height-1

relativeColumnIndex:int

must be between 0 and width-1

Returns:C

the cell at the specified coordinates. Never null.

getCellsback to summary
public C[][] getCells()
Returns:C[][]

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)

getFlattenedCellsback to summary
public C[] getFlattenedCells()
Returns:C[]

a flattened array of all the cells in this CellRange

getHeightback to summary
public int getHeight()
getReferenceTextback to summary
public String getReferenceText()
Returns:String

the text format of this range. Single cell ranges are formatted like single cell references (e.g. 'A1' instead of 'A1:A1').

getTopLeftCellback to summary
public C getTopLeftCell()
Returns:C

the cell at relative coordinates (0,0). Never null.

getWidthback to summary
public int getWidth()
iteratorback to summary
public Iterator<C> iterator()

Redeclares java.lang.Iterable.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Returns:Iterator<C>

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.

Annotations
@Override
sizeback to summary
public int size()

Gets the number of cells in this range.

Returns:int

height * width