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 newBytesRefArray
with a counter to track allocated bytes -
Method Summary
Modifier and TypeMethodDescriptionint
Appends a copy of the givenBytesRef
to thisBytesRefArray
.void
clear()
Clears thisBytesRefArray
Returns the n'th element of thisFixedLengthBytesRefArray
iterator
(Comparator<BytesRef> comp) Returns aBytesRefIterator
with point in time semantics.int
size()
Returns the current size of thisFixedLengthBytesRefArray
-
Constructor Details
-
FixedLengthBytesRefArray
public FixedLengthBytesRefArray(int valueLength) Creates a newBytesRefArray
with a counter to track allocated bytes
-
-
Method Details
-
clear
public void clear()Clears thisBytesRefArray
-
append
Appends a copy of the givenBytesRef
to 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 spareBytesRef
instance. 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 aBytesRefIterator
with point in time semantics. The iterator provides access to all so far appendedBytesRef
instances.The iterator will iterate the byte values in the order specified by the comparator.
This is a non-destructive operation.
-