public class RowRanges extends Object
ColumnIndexFilter#calculateRowRanges(Filter, ColumnIndexStore, Set, long)| Modifier and Type | Class and Description |
|---|---|
static class |
RowRanges.Range |
| Modifier and Type | Method and Description |
|---|---|
static RowRanges |
create(long rowCount,
PrimitiveIterator.OfInt pageIndexes,
OffsetIndex offsetIndex)
Creates a mutable RowRanges object with the following ranges:
|
static RowRanges |
createSingle(long rowCount)
Creates an immutable RowRanges object with the single range [0, rowCount -
1].
|
List<RowRanges.Range> |
getRanges() |
static RowRanges |
intersection(RowRanges left,
RowRanges right)
Calculates the intersection of the two specified RowRanges object.
|
boolean |
isOverlapping(long from,
long to) |
PrimitiveIterator.OfLong |
iterator() |
long |
rowCount() |
String |
toString() |
static RowRanges |
union(RowRanges left,
RowRanges right)
Calculates the union of the two specified RowRanges object.
|
public static final RowRanges EMPTY
public static RowRanges createSingle(long rowCount)
rowCount - a single row countpublic static RowRanges create(long rowCount, PrimitiveIterator.OfInt pageIndexes, OffsetIndex offsetIndex)
[firstRowIndex[0], lastRowIndex[0]], [firstRowIndex[1], lastRowIndex[1]], ..., [firstRowIndex[n], lastRowIndex[n]](See OffsetIndex.getFirstRowIndex and OffsetIndex.getLastRowIndex for details.)
The union of the ranges are calculated so the result ranges always contain the disjunct ranges. See union for details.
rowCount - row countpageIndexes - pageIndexesoffsetIndex - offsetIndexpublic static RowRanges union(RowRanges left, RowRanges right)
For example: [113, 241] ∪ [221, 340] = [113, 340] [113, 230] ∪ [231, 340] = [113, 340] while [113, 230] ∪ [232, 340] = [113, 230], [232, 340]The result RowRanges object will contain all the row indexes that were contained in one of the specified objects.
left - left RowRangesright - right RowRangespublic static RowRanges intersection(RowRanges left, RowRanges right)
For example: [113, 241] ∩ [221, 340] = [221, 241] while [113, 230] ∩ [231, 340] = <EMPTY>
left - left RowRangesright - right RowRangespublic long rowCount()
public PrimitiveIterator.OfLong iterator()
public boolean isOverlapping(long from,
long to)
from - the first row of the range to be checked for connectionto - the last row of the range to be checked for connectiontrue if the specified range is overlapping (have common elements) with one of the rangespublic List<RowRanges.Range> getRanges()
Copyright © 2024 The Apache Software Foundation. All rights reserved.