- All Implemented Interfaces:
Iterable<SuggestWord>
Sorts SuggestWord instances
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Comparator<SuggestWord> static final Comparator<SuggestWord> Default comparator: score then frequency. -
Constructor Summary
ConstructorsConstructorDescriptionSuggestWordQueue(int size) Use theDEFAULT_COMPARATORSuggestWordQueue(int size, Comparator<SuggestWord> comparator) Specify the size of the queue and the comparator to use for sorting. -
Method Summary
Modifier and TypeMethodDescriptionprotected final booleanlessThan(SuggestWord wa, SuggestWord wb) Determines the ordering of objects in this priority queue.Methods inherited from class org.apache.lucene.util.PriorityQueue
add, addAll, clear, getHeapArray, insertWithOverflow, iterator, pop, remove, size, top, updateTop, updateTopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
DEFAULT_COMPARATOR
Default comparator: score then frequency.- See Also:
-
comparator
-
-
Constructor Details
-
SuggestWordQueue
public SuggestWordQueue(int size) Use theDEFAULT_COMPARATOR- Parameters:
size- The size of the queue
-
SuggestWordQueue
Specify the size of the queue and the comparator to use for sorting.- Parameters:
size- The sizecomparator- The comparator.
-
-
Method Details
-
lessThan
Description copied from class:PriorityQueueDetermines the ordering of objects in this priority queue. Subclasses must define this one method.- Specified by:
lessThanin classPriorityQueue<SuggestWord>- Returns:
trueiff parameterais less than parameterb.
-