public final class CellRangeUtil
extends java.lang.Object
CellRangeAddress
Portions of this class may be moved to 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 |
static CellRangeAddress |
createEnclosingCellRange(CellRangeAddress crA,
CellRangeAddress crB)
Create an enclosing CellRange for the two cell ranges.
|
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 rangeNO_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 mergepublic static boolean contains(CellRangeAddress crA, CellRangeAddress crB)
CellRangeAddressBase
crA
- cell range AcrB
- cell range Bpublic 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.public static CellRangeAddress createEnclosingCellRange(CellRangeAddress crA, CellRangeAddress crB)
Copyright 2022 The Apache Software Foundation or its licensors, as applicable.