Class ShiftedRowSequence
- All Implemented Interfaces:
RowSequence,LongSizedDataStructure,SafeCloseable,AutoCloseable
-
Field Summary
Fields inherited from interface io.deephaven.engine.rowset.RowSequence
NULL_ROW_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasRowSet()Get aRowSetrepresentation of thisRowSequence.final voidclear()voidclose()Free any resources associated with this object.voidfillRowKeyChunk(WritableLongChunk<? super OrderedRowKeys> chunkToFill) Fill the suppliedWritableLongChunkwith individual row keys from thisRowSequence.voidfillRowKeyRangesChunk(WritableLongChunk<OrderedRowKeyRanges> chunkToFill) Fill the suppliedWritableLongChunkwith row key ranges from thisRowSequence.longGet the first row key in thisRowSequence.booleanforEachRowKey(LongAbortableConsumer consumer) For as long as the consumer wants more row keys, call accept on the consumer with the individual row key instances in this RowSequence, in increasing order.booleanforEachRowKeyRange(LongRangeAbortableConsumer consumer) For as long as the consumer wants more ranges, call accept on the consumer with the individual row key ranges in this RowSequence, in increasing order.longGet an estimate of the average (mean) length of runs of adjacent row keys in thisRowSequence.getRowSequenceByKeyRange(long startRowKeyInclusive, long endRowKeyInclusive) Get an ordered subset of the row keys in thisRowSequencefor a row key range.getRowSequenceByPosition(long startPositionInclusive, long length) Get an ordered subset of the row keys in thisRowSequencefor a position range.Get anRowSequence.Iteratorover thisRowSequence.booleanisEmpty()True if the size of thisRowSequenceis zero.longGet the last row key in thisRowSequence.longreset(RowSequence toWrap, long shiftAmount) longsize()Get the number of row keys in thisRowSequence.static RowSequencewrap(RowSequence toWrap, long shiftAmount) Methods inherited from class io.deephaven.engine.rowset.impl.RowSequenceAsChunkImpl
asRowKeyChunk, asRowKeyRangesChunk, closeRowSequenceAsChunkImpl, invalidateRowSequenceAsChunkImpl, runsUpperBoundMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.deephaven.util.datastructures.LongSizedDataStructure
intSize, intSizeMethods inherited from interface io.deephaven.engine.rowset.RowSequence
asRowKeyChunk, asRowKeyRangesChunk, forAllRowKeyRanges, forAllRowKeys, isContiguous
-
Constructor Details
-
ShiftedRowSequence
public ShiftedRowSequence()
-
-
Method Details
-
wrap
-
reset
-
clear
public final void clear() -
getRowSequenceIterator
Description copied from interface:RowSequenceGet anRowSequence.Iteratorover thisRowSequence.- Specified by:
getRowSequenceIteratorin interfaceRowSequence- Returns:
- A new iterator, positioned at the first row key
-
getRowSequenceByPosition
Description copied from interface:RowSequenceGet an ordered subset of the row keys in this
RowSequencefor a position range. The result will contain the set of row keys inthisthat lie at positions in the half-open range [startPositionInclusive,startPositionInclusive + length). The returned reference is owned by the caller, who should callclose()when it is done with it.- Specified by:
getRowSequenceByPositionin interfaceRowSequence- Parameters:
startPositionInclusive- The position of the first row key to includelength- The number of row keys to include- Returns:
- The subset as an
RowSequence, which may bethis
-
getRowSequenceByKeyRange
Description copied from interface:RowSequenceGet an ordered subset of the row keys in this
RowSequencefor a row key range. The returned set will be the intersection of the row keys inthiswith the row keys in the closed interval [startRowKeyInclusive,endRowKeyInclusive]. The returned reference is owned by the caller, who should callclose()when it is done with it.- Specified by:
getRowSequenceByKeyRangein interfaceRowSequence- Parameters:
startRowKeyInclusive- The minimum row key to includeendRowKeyInclusive- The maximum row key to include- Returns:
- The subset as an
RowSequence, which may bethis
-
asRowSet
Description copied from interface:RowSequenceGet aRowSetrepresentation of thisRowSequence.- Specified by:
asRowSetin interfaceRowSequence- Returns:
- A
RowSetrepresentation for the same row keys in the same order
-
fillRowKeyChunk
Description copied from interface:RowSequenceFill the supplied
WritableLongChunkwith individual row keys from thisRowSequence.The chunk's capacity is assumed to be big enough.
- Specified by:
fillRowKeyChunkin interfaceRowSequence- Parameters:
chunkToFill- A chunk to fill with individual row keys
-
fillRowKeyRangesChunk
Description copied from interface:RowSequenceFill the supplied
WritableLongChunkwith row key ranges from thisRowSequence.The chunk's capacity is assumed to be big enough.
- Specified by:
fillRowKeyRangesChunkin interfaceRowSequence- Parameters:
chunkToFill- A chunk to fill with row key ranges
-
isEmpty
public boolean isEmpty()Description copied from interface:RowSequenceTrue if the size of thisRowSequenceis zero.- Specified by:
isEmptyin interfaceRowSequence- Returns:
- True if there are no elements in this
RowSequence.
-
firstRowKey
public long firstRowKey()Description copied from interface:RowSequenceGet the first row key in thisRowSequence.- Specified by:
firstRowKeyin interfaceRowSequence- Returns:
- The first row key, or
RowSequence.NULL_ROW_KEYif there is none.
-
lastRowKey
public long lastRowKey()Description copied from interface:RowSequenceGet the last row key in thisRowSequence.- Specified by:
lastRowKeyin interfaceRowSequence- Specified by:
lastRowKeyin classRowSequenceAsChunkImpl- Returns:
- The last row key, or
RowSequence.NULL_ROW_KEYif there is none.
-
size
public long size()Description copied from interface:RowSequenceGet the number of row keys in thisRowSequence.- Specified by:
sizein interfaceLongSizedDataStructure- Specified by:
sizein interfaceRowSequence- Returns:
- The size, in [0,
Long.MAX_VALUE]
-
getAverageRunLengthEstimate
public long getAverageRunLengthEstimate()Description copied from interface:RowSequenceGet an estimate of the average (mean) length of runs of adjacent row keys in this
RowSequence.Implementations should strive to keep this method efficient (O(1) preferred) at the expense of accuracy.
Empty
RowSequenceshould return an arbitrary valid value, usually 1.- Specified by:
getAverageRunLengthEstimatein interfaceRowSequence- Returns:
- An estimate of the average run length in this
RowSequence, in [1,size()]
-
forEachRowKey
Description copied from interface:RowSequenceFor as long as the consumer wants more row keys, call accept on the consumer with the individual row key instances in this RowSequence, in increasing order.- Specified by:
forEachRowKeyin interfaceRowSequence- Parameters:
consumer- a consumer to feed the individual row key values to.- Returns:
- false if the consumer provided ever returned false, true otherwise.
-
forEachRowKeyRange
Description copied from interface:RowSequenceFor as long as the consumer wants more ranges, call accept on the consumer with the individual row key ranges in this RowSequence, in increasing order.- Specified by:
forEachRowKeyRangein interfaceRowSequence- Parameters:
consumer- a consumer to feed the individual row key values to.- Returns:
- false if the consumer provided ever returned false, true otherwise.
-
close
public void close()Description copied from interface:RowSequenceFree any resources associated with this object.
Using any
RowSequencemethods afterclose()is an error and may produce exceptions or undefined results.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceRowSequence- Specified by:
closein interfaceSafeCloseable- Overrides:
closein classRowSequenceAsChunkImpl
-
rangesCountUpperBound
public long rangesCountUpperBound()- Specified by:
rangesCountUpperBoundin classRowSequenceAsChunkImpl
-