Top Description Fields Constructors Methods
org.apache.poi.ss.util

public final Class SSCellRange<K extends Cell>

extends Object
implements CellRange<K extends Cell>
Class Inheritance
All Implemented Interfaces
org.apache.poi.ss.usermodel.CellRange, java.lang.Iterable
Annotations
@Internal
Imports
java.lang.reflect.Array, java.util.Iterator, .List, .Spliterator, java.util.stream.Stream, org.apache.poi.ss.usermodel.Cell, .CellRange, org.apache.poi.util.Internal

For POI internal use only

Field Summary

Modifier and TypeField and Description
private final int
private final int
private final K[]
private final int
private final int

Constructor Summary

AccessConstructor and Description
private
SSCellRange(int firstRow, int firstColumn, int height, int width, K[] flattenedArray)

Method Summary

Modifier and TypeMethod and Description
public static <B extends Cell> SSCellRange<B>
create(int firstRow, int firstColumn, int height, int width, List<B> flattenedList, Class<B> cellClass)

public K
getCell(int
must be between 0 and height-1
relativeRowIndex
,
int
must be between 0 and width-1
relativeColumnIndex
)

Implements org.apache.poi.ss.usermodel.CellRange.getCell.

public K[][]
public K[]
public int
public String
public K
public int
public Iterator<K>
iterator()

Implements org.apache.poi.ss.usermodel.CellRange.iterator.

Returns an iterator over elements of type T.

public int
size()

Implements org.apache.poi.ss.usermodel.CellRange.size.

Gets the number of cells in this range.

public Spliterator<K>
spliterator()

Overrides default java.lang.Iterable.spliterator.

Creates a Spliterator over the elements described by this Iterable.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_firstColumnback to summary
private final int _firstColumn
_firstRowback to summary
private final int _firstRow
_flattenedArrayback to summary
private final K[] _flattenedArray
_heightback to summary
private final int _height
_widthback to summary
private final int _width

Constructor Detail

SSCellRangeback to summary
private SSCellRange(int firstRow, int firstColumn, int height, int width, K[] flattenedArray)

Method Detail

createback to summary
public static <B extends Cell> SSCellRange<B> create(int firstRow, int firstColumn, int height, int width, List<B> flattenedList, Class<B> cellClass)
getCellback to summary
public K getCell(int relativeRowIndex, int relativeColumnIndex)

Implements org.apache.poi.ss.usermodel.CellRange.getCell.

Parameters
relativeRowIndex:int

Doc from org.apache.poi.ss.usermodel.CellRange.getCell.

must be between 0 and height-1

relativeColumnIndex:int

Doc from org.apache.poi.ss.usermodel.CellRange.getCell.

must be between 0 and width-1

Returns:K

Doc from org.apache.poi.ss.usermodel.CellRange.getCell.

the cell at the specified coordinates. Never null.

Annotations
@Override
getCellsback to summary
public K[][] getCells()

Implements org.apache.poi.ss.usermodel.CellRange.getCells.

Returns:K[][]

Doc from org.apache.poi.ss.usermodel.CellRange.getCells.

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)

Annotations
@Override
getFlattenedCellsback to summary
public K[] getFlattenedCells()

Implements org.apache.poi.ss.usermodel.CellRange.getFlattenedCells.

Returns:K[]

Doc from org.apache.poi.ss.usermodel.CellRange.getFlattenedCells.

a flattened array of all the cells in this CellRange

Annotations
@Override
getHeightback to summary
public int getHeight()

Implements org.apache.poi.ss.usermodel.CellRange.getHeight.

Annotations
@Override
getReferenceTextback to summary
public String getReferenceText()

Implements org.apache.poi.ss.usermodel.CellRange.getReferenceText.

Returns:String

Doc from org.apache.poi.ss.usermodel.CellRange.getReferenceText.

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

Annotations
@Override
getTopLeftCellback to summary
public K getTopLeftCell()

Implements org.apache.poi.ss.usermodel.CellRange.getTopLeftCell.

Returns:K

Doc from org.apache.poi.ss.usermodel.CellRange.getTopLeftCell.

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

Annotations
@Override
getWidthback to summary
public int getWidth()

Implements org.apache.poi.ss.usermodel.CellRange.getWidth.

Annotations
@Override
iteratorback to summary
public Iterator<K> iterator()

Implements org.apache.poi.ss.usermodel.CellRange.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Returns:Iterator<K>

Doc from org.apache.poi.ss.usermodel.CellRange.iterator.

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

Implements org.apache.poi.ss.usermodel.CellRange.size.

Doc from org.apache.poi.ss.usermodel.CellRange.size.

Gets the number of cells in this range.

Returns:int

height * width

Annotations
@Override
spliteratorback to summary
public Spliterator<K> spliterator()

Overrides default java.lang.Iterable.spliterator.

Doc from java.lang.Iterable.spliterator.

Creates a Spliterator over the elements described by this Iterable.

Returns:Spliterator<K>

a Spliterator over the elements described by this Iterable.

Annotations
@Override
Since
POI 5.2.0