Package io.deephaven.web.shared.data
Class RangeSet
java.lang.Object
io.deephaven.web.shared.data.RangeSet
This class allows iteration over non-contiguous indexes. In the future, this will support the EcmaScript 2015
Iteration protocol, but for now has one method which returns an iterator, and also supports querying the size.
Additionally, we may add support for creating RangeSet objects to better serve some use cases.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddRangeSet(RangeSet rangeSet) voidapplyShifts(ShiftedRange[] shiftedRanges) voidclear()booleancontains(long value) copy()static RangeSetempty()booleanRemoves all keys in the provided rangeset that are present in this.longfind(long key) static RangeSetfromSortedRanges(Range[] sortedRanges) static RangeSetfromSortedRanges(List<Range> sortedRanges) longget(long key) longlonginthashCode()booleanincludesAllOf(RangeSet other) booleanincludesAnyOf(Range range) booleanisEmpty()booleanisFlat()static RangeSetofItems(long... items) static RangeSetofRange(long first, long last) inta new iterator over all indexes in this collection.voidremoveRange(Range range) voidremoveRangeSet(RangeSet rangeSet) longsize()The total count of items contained in this collection.subsetForPositions(RangeSet positions, boolean reversed) toString()
-
Constructor Details
-
RangeSet
public RangeSet()
-
-
Method Details
-
empty
-
ofRange
-
ofItems
-
fromSortedRanges
-
clear
public void clear() -
rangeIterator
a new iterator over all indexes in this collection.- Returns:
- Iterator of
Range
-
reverseRangeIterator
-
indexIterator
-
rangeCount
public int rangeCount() -
isFlat
public boolean isFlat() -
size
public long size()The total count of items contained in this collection. In some cases this can be expensive to compute, and generally should not be needed except for debugging purposes, or preallocating space (i.e., do not call this property each time through a loop).- Returns:
- long
-
isEmpty
public boolean isEmpty() -
contains
public boolean contains(long value) -
find
public long find(long key) -
toString
-
getFirstRow
public long getFirstRow() -
getLastRow
public long getLastRow() -
copy
-
equals
-
hashCode
public int hashCode() -
get
public long get(long key)
-