|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.lucene.search.suggest.BytesRefList
public final class BytesRefList
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 | |
---|---|
BytesRefList()
Creates a new BytesRefList |
Method Summary | |
---|---|
int |
append(BytesRef bytes)
Appends a copy of the given BytesRef to this BytesRefList . |
long |
bytesUsed()
Returns the number internally used bytes to hold the appended bytes in memory |
void |
clear()
Clears this BytesRefList |
BytesRef |
get(BytesRef spare,
int ord)
Returns the n'th element of this BytesRefList |
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 BytesRefList |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BytesRefList()
BytesRefList
Method Detail |
---|
public void clear()
BytesRefList
public int append(BytesRef bytes)
BytesRef
to this BytesRefList
.
bytes
- the bytes to append
public int size()
BytesRefList
BytesRefList
public BytesRef get(BytesRef spare, int ord)
BytesRefList
spare
- a spare BytesRef
instanceord
- the elements ordinal to retrieve
BytesRefList
public long bytesUsed()
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 |