Package org.apache.lucene.search.spell
Class SuggestWordQueue
- java.lang.Object
-
- org.apache.lucene.util.PriorityQueue<SuggestWord>
-
- org.apache.lucene.search.spell.SuggestWordQueue
-
- All Implemented Interfaces:
java.lang.Iterable<SuggestWord>
public final class SuggestWordQueue extends PriorityQueue<SuggestWord>
Sorts SuggestWord instances
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Comparator<SuggestWord>
comparator
static java.util.Comparator<SuggestWord>
DEFAULT_COMPARATOR
Default comparator: score then frequency.
-
Constructor Summary
Constructors Constructor Description SuggestWordQueue(int size)
Use theDEFAULT_COMPARATOR
SuggestWordQueue(int size, java.util.Comparator<SuggestWord> comparator)
Specify the size of the queue and the comparator to use for sorting.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
lessThan(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, updateTop
-
-
-
-
Field Detail
-
DEFAULT_COMPARATOR
public static final java.util.Comparator<SuggestWord> DEFAULT_COMPARATOR
Default comparator: score then frequency.- See Also:
SuggestWordScoreComparator
-
comparator
private java.util.Comparator<SuggestWord> comparator
-
-
Constructor Detail
-
SuggestWordQueue
public SuggestWordQueue(int size)
Use theDEFAULT_COMPARATOR
- Parameters:
size
- The size of the queue
-
SuggestWordQueue
public SuggestWordQueue(int size, java.util.Comparator<SuggestWord> comparator)
Specify the size of the queue and the comparator to use for sorting.- Parameters:
size
- The sizecomparator
- The comparator.
-
-
Method Detail
-
lessThan
protected final boolean lessThan(SuggestWord wa, SuggestWord wb)
Description copied from class:PriorityQueue
Determines the ordering of objects in this priority queue. Subclasses must define this one method.- Specified by:
lessThan
in classPriorityQueue<SuggestWord>
- Returns:
true
iff parametera
is less than parameterb
.
-
-