|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.poi.ss.util.CellRangeAddressBase
public abstract class CellRangeAddressBase
See OOO documentation: excelfileformat.pdf sec 2.5.14 - 'Cell Range Address'
Common superclass of 8-bit and 16-bit versions
Nested Class Summary | |
---|---|
static class |
CellRangeAddressBase.CellPosition
Indicates a cell or range is in the given relative position in a range. |
Constructor Summary | |
---|---|
protected |
CellRangeAddressBase(int firstRow,
int lastRow,
int firstCol,
int lastCol)
|
Method Summary | |
---|---|
boolean |
containsColumn(int colInd)
Check if the column is in the specified cell range |
boolean |
containsRow(int rowInd)
Check if the row is in the specified cell range |
boolean |
equals(java.lang.Object other)
|
int |
getFirstColumn()
|
int |
getFirstRow()
|
int |
getLastColumn()
|
int |
getLastRow()
|
protected int |
getMaxColumn()
|
protected int |
getMaxRow()
|
protected int |
getMinColumn()
|
protected int |
getMinRow()
|
int |
getNumberOfCells()
|
java.util.Set<CellRangeAddressBase.CellPosition> |
getPosition(int rowInd,
int colInd)
Useful for logic like table/range styling, where some elements apply based on relative position in a range. |
int |
hashCode()
|
boolean |
intersects(CellRangeAddressBase other)
Determines whether or not this CellRangeAddress and the specified CellRangeAddress intersect. |
boolean |
isFullColumnRange()
|
boolean |
isFullRowRange()
|
boolean |
isInRange(Cell cell)
Determines if the given Cell lies within the bounds
of this range. |
boolean |
isInRange(CellReference ref)
Determines if the given CellReference lies within the bounds
of this range. |
boolean |
isInRange(int rowInd,
int colInd)
Determines if the given coordinates lie within the bounds of this range. |
void |
setFirstColumn(int firstCol)
|
void |
setFirstRow(int firstRow)
|
void |
setLastColumn(int lastCol)
|
void |
setLastRow(int lastRow)
|
java.lang.String |
toString()
|
void |
validate(SpreadsheetVersion ssVersion)
Validate the range limits against the supplied version of Excel |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected CellRangeAddressBase(int firstRow, int lastRow, int firstCol, int lastCol)
Method Detail |
---|
public void validate(SpreadsheetVersion ssVersion)
ssVersion
- the version of Excel to validate against
java.lang.IllegalArgumentException
- if the range limits are outside of the allowed rangepublic final boolean isFullColumnRange()
public final boolean isFullRowRange()
public final int getFirstColumn()
public final int getFirstRow()
public final int getLastColumn()
public final int getLastRow()
public boolean isInRange(int rowInd, int colInd)
rowInd
- The row, 0-based.colInd
- The column, 0-based.
for checking if two ranges overlap
public boolean isInRange(CellReference ref)
CellReference
lies within the bounds
of this range.
NOTE: It is up to the caller to ensure the reference is for the correct sheet, since this instance doesn't have a sheet reference.
ref
- the CellReference to check
for checking if two ranges overlap
public boolean isInRange(Cell cell)
Cell
lies within the bounds
of this range.
NOTE: It is up to the caller to ensure the reference is for the correct sheet, since this instance doesn't have a sheet reference.
cell
- the Cell to check
for checking if two ranges overlap
public boolean containsRow(int rowInd)
rowInd
- the row to check
public boolean containsColumn(int colInd)
colInd
- the column to check
public boolean intersects(CellRangeAddressBase other)
other
- a candidate cell range address to check for intersection with this range
for checking if a single cell intersects
public java.util.Set<CellRangeAddressBase.CellPosition> getPosition(int rowInd, int colInd)
rowInd
- colInd
-
CellRangeAddressBase.CellPosition
s occupied by the given coordinates. Empty if the coordinates are not in the range, never null.public final void setFirstColumn(int firstCol)
firstCol
- column number for the upper left hand cornerpublic final void setFirstRow(int firstRow)
firstRow
- row number for the upper left hand cornerpublic final void setLastColumn(int lastCol)
lastCol
- column number for the lower right hand cornerpublic final void setLastRow(int lastRow)
lastRow
- row number for the lower right hand cornerpublic int getNumberOfCells()
public final java.lang.String toString()
toString
in class java.lang.Object
protected int getMinRow()
protected int getMaxRow()
protected int getMinColumn()
protected int getMaxColumn()
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |