Package org.apache.druid.segment.data
Class GenericIndexed.BufferIndexed
java.lang.Object
org.apache.druid.segment.data.GenericIndexed.BufferIndexed
- All Implemented Interfaces:
Iterable<T>,HotLoopCallee,Indexed<T>
- Enclosing class:
- GenericIndexed<T>
Single-threaded view.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget(int index) Get the value at specified positionprotected abstract ByteBuffergetByteBuffer(int index) intReturns the index of "value" in this Indexed object, or a negative number if the value is not present.booleanisSorted()Indicates if this value set is sorted, the implication being that the contract ofIndexed.indexOf(T)is strenthened to return a negative number equal to (-(insertion point) - 1) when the value is not present in the set.iterator()intsize()Number of elements in the value setMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.druid.query.monomorphicprocessing.HotLoopCallee
inspectRuntimeShapeMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
BufferIndexed
public BufferIndexed()
-
-
Method Details
-
size
public int size()Description copied from interface:IndexedNumber of elements in the value set -
get
Description copied from interface:IndexedGet the value at specified position -
getByteBuffer
Likeget(int), but returns aByteBufferinstead of using theObjectStrategy. The returned ByteBuffer is reused by future calls. Callers must discard it before calling another method on this BufferedIndexed object that may want to reuse the buffer. -
indexOf
Description copied from interface:IndexedReturns the index of "value" in this Indexed object, or a negative number if the value is not present. The negative number is not guaranteed to be any particular number unlessIndexed.isSorted()returns true, in which case it will be a negative number equal to (-(insertion point) - 1), in the manner of Arrays.binarySearch.- Specified by:
indexOfin interfaceIndexed<T>- Parameters:
value- value to search for- Returns:
- index of value, or a negative number (equal to (-(insertion point) - 1) if
Indexed.isSorted())
-
isSorted
public boolean isSorted()Description copied from interface:IndexedIndicates if this value set is sorted, the implication being that the contract ofIndexed.indexOf(T)is strenthened to return a negative number equal to (-(insertion point) - 1) when the value is not present in the set. -
iterator
-