Package org.apache.lucene.search.suggest
Class Lookup.LookupPriorityQueue
- java.lang.Object
-
- org.apache.lucene.util.PriorityQueue<Lookup.LookupResult>
-
- org.apache.lucene.search.suggest.Lookup.LookupPriorityQueue
-
- All Implemented Interfaces:
java.lang.Iterable<Lookup.LookupResult>
- Enclosing class:
- Lookup
public static final class Lookup.LookupPriorityQueue extends PriorityQueue<Lookup.LookupResult>
APriorityQueue
collecting a fixed size of high priorityLookup.LookupResult
-
-
Constructor Summary
Constructors Constructor Description LookupPriorityQueue(int size)
Creates a new priority queue of the specified size.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Lookup.LookupResult[]
getResults()
Returns the top N results in descending order.protected boolean
lessThan(Lookup.LookupResult a, Lookup.LookupResult b)
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
-
-
-
-
Method Detail
-
lessThan
protected boolean lessThan(Lookup.LookupResult a, Lookup.LookupResult b)
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<Lookup.LookupResult>
- Returns:
true
iff parametera
is less than parameterb
.
-
getResults
public Lookup.LookupResult[] getResults()
Returns the top N results in descending order.- Returns:
- the top N results in descending order.
-
-