Package org.apache.poi.ss.util
Class CellRangeAddress
java.lang.Object
org.apache.poi.ss.util.CellRangeAddressBase
org.apache.poi.ss.util.CellRangeAddress
- All Implemented Interfaces:
Iterable<CellAddress>
See OOO documentation: excelfileformat.pdf sec 2.5.14 - 'Cell Range Address'
In the Microsoft documentation, this is also known as a
Ref8U - see page 831 of version 1.0 of the documentation.
Note - SelectionRecord
uses the BIFF5 version of this structure
- Author:
- Dragos Buleandra (dragos.buleandra@trade2b.ro)
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.poi.ss.util.CellRangeAddressBase
CellRangeAddressBase.CellPosition
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCellRangeAddress
(int firstRow, int lastRow, int firstCol, int lastCol) Creates new cell range. -
Method Summary
Modifier and TypeMethodDescriptioncopy()
formatAsString
(String sheetName, boolean useAbsoluteAddress) static int
getEncodedSize
(int numberOfItems) void
static CellRangeAddress
Creates a CellRangeAddress from a cell range reference string.Methods inherited from class org.apache.poi.ss.util.CellRangeAddressBase
containsColumn, containsRow, equals, getFirstColumn, getFirstRow, getLastColumn, getLastRow, getMaxColumn, getMaxRow, getMinColumn, getMinRow, getNumberOfCells, getPosition, hashCode, intersects, isFullColumnRange, isFullRowRange, isInRange, isInRange, isInRange, isInRange, iterator, setFirstColumn, setFirstRow, setLastColumn, setLastRow, toString, validate
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
ENCODED_SIZE
public static final int ENCODED_SIZE- See Also:
-
-
Constructor Details
-
CellRangeAddress
public CellRangeAddress(int firstRow, int lastRow, int firstCol, int lastCol) Creates new cell range. Indexes are zero-based.- Parameters:
firstRow
- Index of first rowlastRow
- Index of last row (inclusive), must be equal to or larger thanfirstRow
firstCol
- Index of first columnlastCol
- Index of last column (inclusive), must be equal to or larger thanfirstCol
-
CellRangeAddress
-
-
Method Details
-
serialize
-
copy
-
getEncodedSize
public static int getEncodedSize(int numberOfItems) -
formatAsString
- Returns:
- the text format of this range. Single cell ranges are formatted like single cell references (e.g. 'A1' instead of 'A1:A1').
-
formatAsString
- Returns:
- the text format of this range using specified sheet name.
-
valueOf
Creates a CellRangeAddress from a cell range reference string.- Parameters:
ref
- usually a standard area ref (e.g. "B1:D8"). May be a single cell ref (e.g. "B5") in which case the result is a 1 x 1 cell range. May also be a whole row range (e.g. "3:5"), or a whole column range (e.g. "C:F")
-