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>
public abstract class GenericIndexed.BufferIndexed extends Object implements Indexed<T>
Single-threaded view.
-
-
Constructor Summary
Constructors Constructor Description BufferIndexed()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Tget(int index)Get the value at specified positionprotected abstract ByteBuffergetByteBuffer(int index)intindexOf(T value)Returns 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<T>iterator()intsize()Number of elements in the value set-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.druid.query.monomorphicprocessing.HotLoopCallee
inspectRuntimeShape
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
size
public int size()
Description copied from interface:IndexedNumber of elements in the value set
-
get
public T get(int index)
Description copied from interface:IndexedGet the value at specified position
-
getByteBuffer
@Nullable protected abstract ByteBuffer getByteBuffer(int index)
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
public int indexOf(@Nullable T value)
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.
-
-