Package org.apache.lucene.util
Class FixedLengthBytesRefArray
java.lang.Object
org.apache.lucene.util.FixedLengthBytesRefArray
Just like
BytesRefArray except all values have the same length.
Note: This class is not Thread-Safe!
- WARNING: This API is experimental and might change in incompatible ways in the next release.
- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
Constructor Summary
ConstructorsConstructorDescriptionFixedLengthBytesRefArray(int valueLength) Creates a newBytesRefArraywith a counter to track allocated bytes -
Method Summary
Modifier and TypeMethodDescriptionintAppends a copy of the givenBytesRefto thisBytesRefArray.voidclear()Clears thisBytesRefArrayReturns the n'th element of thisFixedLengthBytesRefArrayiterator(Comparator<BytesRef> comp) Returns aBytesRefIteratorwith point in time semantics.intsize()Returns the current size of thisFixedLengthBytesRefArray
-
Constructor Details
-
FixedLengthBytesRefArray
public FixedLengthBytesRefArray(int valueLength) Creates a newBytesRefArraywith a counter to track allocated bytes
-
-
Method Details
-
clear
public void clear()Clears thisBytesRefArray -
append
Appends a copy of the givenBytesRefto thisBytesRefArray.- Parameters:
bytes- the bytes to append- Returns:
- the index of the appended bytes
-
get
Returns the n'th element of thisFixedLengthBytesRefArray- Parameters:
spare- a spareBytesRefinstance. The length of this spare should be equal to the fixed length.index- the elements index to retrieve- Returns:
- the n'th element of this
FixedLengthBytesRefArray
-
size
public int size()Returns the current size of thisFixedLengthBytesRefArray- Returns:
- the current size of this
FixedLengthBytesRefArray
-
iterator
Returns aBytesRefIteratorwith point in time semantics. The iterator provides access to all so far appendedBytesRefinstances.The iterator will iterate the byte values in the order specified by the comparator.
This is a non-destructive operation.
-