public final class CellRangeUtil
extends java.lang.Object
CellRangeAddress
Portions of this class may be moved to
CellRangeAddressBase
(建立在 CellRangeAddress 上的实用程序类 此类的部分可以移动到 CellRangeAddressBase)
Modifier and Type | Field and Description |
---|---|
static int |
ENCLOSES
first range encloses or is equal to the second
(第一个范围包含或等于第二个)
|
static int |
INSIDE
first range is within the second range
(第一个范围在第二个范围内)
|
static int |
NO_INTERSECTION |
static int |
OVERLAP |
Modifier and Type | Method and Description |
---|---|
static boolean |
contains(CellRangeAddress crA, CellRangeAddress crB)
Check if cell range A contains cell range B (B <= A) TODO: move this into
CellRangeAddressBase
(检查单元格范围 A 是否包含单元格范围 B (B <= A) TODO: 将其移动到 CellRangeAddressBase)
|
static CellRangeAddress |
createEnclosingCellRange(CellRangeAddress crA, CellRangeAddress crB)
Create an enclosing CellRange for the two cell ranges.
(为两个单元格区域创建一个封闭的 CellRange。)
|
static boolean |
hasExactSharedBorder(CellRangeAddress crA, CellRangeAddress crB)
Check if the two cell ranges have a shared border.
(检查两个单元格区域是否具有共享边框。)
|
static int |
intersect(CellRangeAddress crA, CellRangeAddress crB)
Get the type of intersection between two cell ranges
(获取两个单元格区域之间的交集类型)
|
static CellRangeAddress[] |
mergeCellRanges(CellRangeAddress[] cellRanges)
Do all possible cell merges between cells of the list so that:
if a cell range is completely inside of another cell range, it gets removed from the list if two cells have a shared border, merge them into one bigger cell range (在列表的单元格之间进行所有可能的单元格合并,以便:如果一个单元格范围完全在另一个单元格范围内,如果两个单元格具有共享边框,则将其从列表中删除,将它们合并到一个更大的单元格范围内) |
public static final int NO_INTERSECTION
public static final int OVERLAP
public static final int INSIDE
public static final int ENCLOSES
public static int intersect(CellRangeAddress crA, CellRangeAddress crB)
crB
- - the specified range
(crB - - 指定范围)
NO_INTERSECTION
- the specified range is outside of this range;OVERLAP
- both ranges partially overlapINSIDE
- the specified range is inside of this oneENCLOSES
- the specified range encloses (possibly exactly the same as) this rangeCellRangeAddressBase.intersects(CellRangeAddressBase)
public static CellRangeAddress[] mergeCellRanges(CellRangeAddress[] cellRanges)
cellRanges
- the ranges to merge
(cellRanges - 要合并的范围)
public static boolean contains(CellRangeAddress crA, CellRangeAddress crB)
CellRangeAddressBase
(检查单元格范围 A 是否包含单元格范围 B (B <= A) TODO: 将其移动到 CellRangeAddressBase)
crA
- cell range A
(crA - 单元格范围 A)
crB
- cell range B
(crB - 单元格范围 B)
public static boolean hasExactSharedBorder(CellRangeAddress crA, CellRangeAddress crB)
true
if the ranges have a complete shared border (i.e. the two ranges together make a simple rectangular region.
(如果范围具有完整的共享边界,则为 true(即两个范围一起构成一个简单的矩形区域。)
public static CellRangeAddress createEnclosingCellRange(CellRangeAddress crA, CellRangeAddress crB)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.