Interface BytesRefSorter
-
- All Known Implementing Classes:
ExternalRefSorter
,InMemorySorter
public interface BytesRefSorter
CollectsBytesRef
and then allows one to iterate over their sorted order. Implementations of this interface will be called in a single-threaded scenario.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
add(BytesRef utf8)
Adds a single suggestion entry (possibly compound with its bucket).java.util.Comparator<BytesRef>
getComparator()
Comparator used to determine the sort order of entries.BytesRefIterator
iterator()
Sorts the entries added inadd(BytesRef)
and returns an iterator over all sorted entries.
-
-
-
Method Detail
-
add
void add(BytesRef utf8) throws java.io.IOException, java.lang.IllegalStateException
Adds a single suggestion entry (possibly compound with its bucket).- Throws:
java.io.IOException
- If an I/O exception occurs.java.lang.IllegalStateException
- If an addition attempt is performed after a call toiterator()
has been made.
-
iterator
BytesRefIterator iterator() throws java.io.IOException
Sorts the entries added inadd(BytesRef)
and returns an iterator over all sorted entries.- Throws:
java.io.IOException
- If an I/O exception occurs.
-
getComparator
java.util.Comparator<BytesRef> getComparator()
Comparator used to determine the sort order of entries.
-
-