BytesRefArray

A simple append only random-access BytesRef array that stores full copies of the appended bytes in a ByteBlockPool.

Note: This class is not Thread-Safe!

Constructors

Link copied to clipboard
constructor(bytesUsed: Counter)

Types

Link copied to clipboard

An extension of BytesRefIterator that allows retrieving the index of the current element

Link copied to clipboard

Used to iterate the elements of an array in a given order.

Functions

Link copied to clipboard
open override fun append(bytes: BytesRef): Int

Appends a copy of the given BytesRef to this BytesRefArray.

Link copied to clipboard
open override fun clear()

Clears this BytesRefArray

Link copied to clipboard
fun get(spare: BytesRefBuilder, index: Int): BytesRef

Returns the n'th element of this BytesRefArray

Link copied to clipboard

sugar for .iterator with a null comparator

open override fun iterator(comp: Comparator<BytesRef>): BytesRefIterator

Returns a BytesRefIterator with point in time semantics. The iterator provides access to all so far appended BytesRef instances.

Returns an IndexedBytesRefIterator with point in time semantics. The iterator provides access to all so far appended BytesRef instances. If a non-null sortState is specified then the iterator will iterate the byte values in the order of the sortState; otherwise, the order is the same as the values were appended.

Link copied to clipboard
open override fun size(): Int

Returns the current size of this BytesRefArray

Link copied to clipboard

Returns a SortState representing the order of elements in this array. This is a non-destructive operation.