Class SingleRangeOrderedKeys
java.lang.Object
com.illumon.iris.db.v2.utils.OrderedKeysAsChunkImpl
com.illumon.iris.db.v2.utils.singlerange.SingleRangeOrderedKeys
- All Implemented Interfaces:
LongSizedDataStructure
,OrderedKeys
,SingleRangeMixin
,SafeCloseable
,AutoCloseable
public class SingleRangeOrderedKeys extends OrderedKeysAsChunkImpl implements SingleRangeMixin
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.illumon.iris.db.v2.utils.OrderedKeys
OrderedKeys.Iterator
-
Field Summary
-
Method Summary
Modifier and Type Method Description Index
asIndex()
Get anIndex
representation of thisOrderedKeys
.SingleRangeOrderedKeys
copy()
void
fillKeyIndicesChunk(WritableLongChunk<? extends Attributes.KeyIndices> chunkToFill)
Fill the suppliedWritableLongChunk
with individual keys from thisOrderedKeys
.void
fillKeyRangesChunk(WritableLongChunk<Attributes.OrderedKeyRanges> chunkToFill)
Fill the suppliedWritableLongChunk
with key ranges from thisOrderedKeys
.long
firstKey()
Get the first key in thisOrderedKeys
.boolean
isEmpty()
True if the size of thisOrderedkeys
is zero.long
lastKey()
Get the last key in thisOrderedKeys
.long
rangeEnd()
long
rangesCountUpperBound()
long
rangeStart()
protected void
reset(long rangeStart, long rangeEnd)
long
size()
Get the number of keys in thisOrderedKeys
.Methods inherited from class com.illumon.iris.db.v2.utils.OrderedKeysAsChunkImpl
asKeyIndicesChunk, asKeyRangesChunk, close, closeOrderedKeysAsChunkImpl, invalidateOrderedKeysAsChunkImpl, runsUpperBound
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.illumon.iris.db.v2.utils.OrderedKeys
asKeyIndicesChunk, asKeyRangesChunk, close, forAllLongRanges, forAllLongs
Methods inherited from interface com.illumon.iris.db.v2.utils.singlerange.SingleRangeMixin
forEachLong, forEachLongRange, getAverageRunLengthEstimate, getOrderedKeysByKeyRange, getOrderedKeysByPosition, getOrderedKeysIterator, isContiguous
-
Method Details
-
rangeStart
public long rangeStart()- Specified by:
rangeStart
in interfaceSingleRangeMixin
-
rangeEnd
public long rangeEnd()- Specified by:
rangeEnd
in interfaceSingleRangeMixin
-
reset
protected void reset(long rangeStart, long rangeEnd) -
copy
-
isEmpty
public boolean isEmpty()Description copied from interface:OrderedKeys
True if the size of thisOrderedkeys
is zero.- Specified by:
isEmpty
in interfaceOrderedKeys
- Returns:
- True if there are no elements in this
OrderedKeys
.
-
lastKey
public long lastKey()Description copied from interface:OrderedKeys
Get the last key in thisOrderedKeys
.- Specified by:
lastKey
in interfaceOrderedKeys
- Specified by:
lastKey
in classOrderedKeysAsChunkImpl
- Returns:
- The last key, or
ReadOnlyIndex.NULL_KEY
if there is none.
-
firstKey
public long firstKey()Description copied from interface:OrderedKeys
Get the first key in thisOrderedKeys
.- Specified by:
firstKey
in interfaceOrderedKeys
- Returns:
- The first key, or
ReadOnlyIndex.NULL_KEY
if there is none.
-
size
public long size()Description copied from interface:OrderedKeys
Get the number of keys in thisOrderedKeys
.- Specified by:
size
in interfaceLongSizedDataStructure
- Specified by:
size
in interfaceOrderedKeys
- Specified by:
size
in interfaceSingleRangeMixin
- Returns:
- The size, in [0,
Long.MAX_VALUE
]
-
rangesCountUpperBound
public long rangesCountUpperBound()- Specified by:
rangesCountUpperBound
in interfaceSingleRangeMixin
- Specified by:
rangesCountUpperBound
in classOrderedKeysAsChunkImpl
-
asIndex
Description copied from interface:OrderedKeys
Get anIndex
representation of thisOrderedKeys
.- Specified by:
asIndex
in interfaceOrderedKeys
- Returns:
- An
Index
representation for the same keys in the same order
-
fillKeyIndicesChunk
Description copied from interface:OrderedKeys
Fill the supplied
WritableLongChunk
with individual keys from thisOrderedKeys
.The chunk's capacity is assumed to be big enough.
- Specified by:
fillKeyIndicesChunk
in interfaceOrderedKeys
- Parameters:
chunkToFill
- A chunk to fill with individual keys
-
fillKeyRangesChunk
Description copied from interface:OrderedKeys
Fill the supplied
WritableLongChunk
with key ranges from thisOrderedKeys
.The chunk's capacity is assumed to be big enough.
- Specified by:
fillKeyRangesChunk
in interfaceOrderedKeys
- Parameters:
chunkToFill
- A chunk to fill with key ranges
-