public abstract class GenericIndexed.BufferIndexed extends Object implements Indexed<T>
| Constructor and Description |
|---|
BufferIndexed() |
| Modifier and Type | Method and Description |
|---|---|
T |
get(int index)
Get the value at specified position
|
protected abstract ByteBuffer |
getByteBuffer(int index)
|
int |
indexOf(T value)
Returns the index of "value" in this Indexed object, or a negative number if the value is not present.
|
boolean |
isSorted()
Indicates if this value set is sorted, the implication being that the contract of
Indexed.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() |
int |
size()
Number of elements in the value set
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcheckIndexforEach, spliteratorinspectRuntimeShapepublic int size()
Indexedpublic T get(int index)
Indexed@Nullable protected abstract ByteBuffer getByteBuffer(int index)
get(int), but returns a ByteBuffer instead of using the ObjectStrategy.
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.public int indexOf(@Nullable T value)
IndexedIndexed.isSorted() returns true, in
which case it will be a negative number equal to (-(insertion point) - 1), in the manner of Arrays.binarySearch.indexOf in interface Indexed<T>value - value to search forIndexed.isSorted())public boolean isSorted()
IndexedIndexed.indexOf(T) is strenthened
to return a negative number equal to (-(insertion point) - 1) when the value is not present in the set.Copyright © 2011–2022 The Apache Software Foundation. All rights reserved.