Class Overview
Expert: A hit queue for sorting by hits by terms in more than one field.
Uses FieldCache.DEFAULT
for maintaining
internal term lookup tables.
NOTE: This API is experimental and might change in
incompatible ways in the next release.
Summary
Protected Methods |
abstract
boolean
|
lessThan(FieldValueHitQueue.Entry a, FieldValueHitQueue.Entry b)
Determines the ordering of objects in this priority queue.
|
[Expand]
Inherited Methods |
From class
org.apache.lucene.util.PriorityQueue
final
T
|
add(T element)
Adds an Object to a PriorityQueue in log(size) time.
|
final
void
|
clear()
Removes all entries from the PriorityQueue.
|
T
|
getSentinelObject()
This method can be overridden by extending classes to return a sentinel
object which will be used by initialize(int) to fill the queue, so
that the code which uses that queue can always assume it's full and only
change the top without attempting to insert any new object.
|
final
void
|
initialize(int maxSize)
Subclass constructors must call this.
|
T
|
insertWithOverflow(T element)
Adds an Object to a PriorityQueue in log(size) time.
|
abstract
boolean
|
lessThan(T a, T b)
Determines the ordering of objects in this priority queue.
|
final
T
|
pop()
Removes and returns the least element of the PriorityQueue in log(size)
time.
|
final
int
|
size()
Returns the number of elements currently stored in the PriorityQueue.
|
final
T
|
top()
Returns the least element of the PriorityQueue in constant time.
|
final
T
|
updateTop()
Should be called when the Object at top changes values.
|
|
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
|
Fields
protected
final
SortField[]
fields
Stores the sort criteria being used.
protected
final
int[]
reverseMul
Public Methods
Creates a hit queue sorted by the given list of fields.
NOTE: The instances returned by this method
pre-allocate a full array of length numHits
.
Parameters
fields
| SortField array we are sorting by in priority order (highest
priority first); cannot be null or empty |
size
| The number of hits to retain. Must be greater than zero. |
Protected Methods
protected
abstract
boolean
lessThan
(FieldValueHitQueue.Entry a, FieldValueHitQueue.Entry b)
Determines the ordering of objects in this priority queue. Subclasses
must define this one method.