|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.search.suggest.BytesRefArray
public final class 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!
Constructor Summary | |
---|---|
BytesRefArray(Counter bytesUsed)
Creates a new BytesRefArray with a counter to track allocated bytes |
Method Summary | |
---|---|
int |
append(BytesRef bytes)
Appends a copy of the given BytesRef to this BytesRefArray . |
void |
clear()
Clears this BytesRefArray |
BytesRef |
get(BytesRef spare,
int index)
Returns the n'th element of this BytesRefArray |
BytesRefIterator |
iterator()
sugar for iterator(Comparator) with a null comparator |
BytesRefIterator |
iterator(Comparator<BytesRef> comp)
Returns a BytesRefIterator with point in time semantics. |
int |
size()
Returns the current size of this BytesRefArray |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BytesRefArray(Counter bytesUsed)
BytesRefArray
with a counter to track allocated bytes
Method Detail |
---|
public void clear()
BytesRefArray
public int append(BytesRef bytes)
BytesRef
to this BytesRefArray
.
bytes
- the bytes to append
public int size()
BytesRefArray
BytesRefArray
public BytesRef get(BytesRef spare, int index)
BytesRefArray
spare
- a spare BytesRef
instanceindex
- the elements index to retrieve
BytesRefArray
public BytesRefIterator iterator()
iterator(Comparator)
with a null
comparator
public BytesRefIterator iterator(Comparator<BytesRef> comp)
Returns a BytesRefIterator
with point in time semantics. The
iterator provides access to all so far appended BytesRef
instances.
If a non null
Comparator
is provided the iterator will
iterate the byte values in the order specified by the comparator. Otherwise
the order is the same as the values were appended.
This is a non-destructive operation.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |