public abstract class CellRangeAddressBase extends java.lang.Object implements java.lang.Iterable<CellAddress>, Duplicatable, GenericRecord
Common superclass of 8-bit and 16-bit versions
(请参阅 OOO 文档:excelfileformat.pdf sec 2.5.14 - 'Cell Range Address' 8 位和 16 位版本的通用超类)Modifier and Type | Class and Description |
---|---|
static class |
CellRangeAddressBase.CellPosition
Indicates a cell or range is in the given relative position in a range.
(指示单元格或范围位于范围内的给定相对位置。)
|
Modifier | Constructor and Description |
---|---|
protected |
CellRangeAddressBase(int firstRow, int lastRow, int firstCol, int lastCol) |
Modifier and Type | Method and Description |
---|---|
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() |
java.util.Map<java.lang.String,java.util.function.Supplier<?>> |
getGenericProperties() |
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.
(确定此 CellRangeAddress 是否与指定的 CellRangeAddress 相交。)
|
boolean |
isFullColumnRange() |
boolean |
isFullRowRange() |
boolean |
isInRange(Cell cell)
Determines if the given
Cell lies within the bounds of this range.
(确定给定的 Cell 是否在此范围的范围内。)
|
boolean |
isInRange(CellAddress ref)
Determines if the given
CellAddress lies within the bounds of this range.
(确定给定的 CellAddress 是否在此范围的范围内。)
|
boolean |
isInRange(CellReference ref)
Determines if the given
CellReference lies within the bounds of this range.
(确定给定的 CellReference 是否在此范围的范围内。)
|
boolean |
isInRange(int rowInd, int colInd)
Determines if the given coordinates lie within the bounds of this range.
(确定给定坐标是否在此范围的范围内。)
|
java.util.Iterator<CellAddress> |
iterator()
Returns an iterator over the CellAddresses in this cell range in row-major order.
(以行优先顺序返回此单元格区域中的 CellAddresses 的迭代器。)
|
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
(根据提供的 Excel 版本验证范围限制)
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
copy
getGenericChildren, getGenericRecordType
protected CellRangeAddressBase(int firstRow, int lastRow, int firstCol, int lastCol)
public void validate(SpreadsheetVersion ssVersion)
ssVersion
- the version of Excel to validate against
(ssVersion - 要验证的 Excel 版本)
java.lang.IllegalArgumentException
- if the range limits are outside of the allowed range
(java.lang.IllegalArgumentException - 如果范围限制超出允许范围)
public 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.
(rowInd - 行,从 0 开始。)
colInd
- The column, 0-based.
(colInd - 列,从 0 开始。)
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.
(确定给定的 CellReference 是否在此范围的范围内。注意:由调用者确保引用适用于正确的工作表,因为此实例没有工作表引用。)ref
- the CellReference to check
(ref - 要检查的 CellReference)
for checking if two ranges overlap
public boolean isInRange(CellAddress ref)
CellAddress
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.
(确定给定的 CellAddress 是否在此范围的范围内。注意:由调用者确保引用适用于正确的工作表,因为此实例没有工作表引用。)ref
- the CellAddress to check
(ref - 要检查的 CellAddress)
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 是否在此范围的范围内。注意:由调用者确保引用适用于正确的工作表,因为此实例没有工作表引用。)cell
- the Cell to check
(cell - 要检查的单元格)
for checking if two ranges overlap
public boolean containsRow(int rowInd)
rowInd
- the row to check
(rowInd - 要检查的行)
public boolean containsColumn(int colInd)
colInd
- the column to check
(colInd - 要检查的列)
public boolean intersects(CellRangeAddressBase other)
other
- a candidate cell range address to check for intersection with this range
(other - 用于检查与此范围相交的候选单元格范围地址)
for checking if a single cell intersects
public java.util.Set<CellRangeAddressBase.CellPosition> getPosition(int rowInd, int colInd)
rowInd
-
(rowInd -)
colInd
-
(colInd -)
CellRangeAddressBase.CellPosition
s occupied by the given coordinates. Empty if the coordinates are not in the range, never null.
(给定坐标占用的一组 CellRangeAddressBase.CellPositions。如果坐标不在范围内,则为空,从不为空。)
public final void setFirstColumn(int firstCol)
firstCol
- column number for the upper left hand corner
(firstCol - 左上角的列号)
public final void setFirstRow(int firstRow)
firstRow
- row number for the upper left hand corner
(firstRow - 左上角的行号)
public final void setLastColumn(int lastCol)
lastCol
- column number for the lower right hand corner
(lastCol - 右下角的列号)
public final void setLastRow(int lastRow)
lastRow
- row number for the lower right hand corner
(lastRow - 右下角的行号)
public int getNumberOfCells()
public java.util.Iterator<CellAddress> iterator()
iterator
in interface
java.lang.Iterable<CellAddress>
(接口 java.lang.Iterable 中的迭代器
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
public java.util.Map<java.lang.String,java.util.function.Supplier<?>> getGenericProperties()
getGenericProperties
in interface
GenericRecord
(接口 GenericRecord 中的 getGenericProperties)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.