public abstract class FieldValueHitQueue<T extends FieldValueHitQueue.Entry> extends PriorityQueue<T>
FieldCache.DEFAULT
for maintaining
internal term lookup tables.Searcher.search(Query,Filter,int,Sort)
,
FieldCache
Modifier and Type | Class and Description |
---|---|
static class |
FieldValueHitQueue.Entry |
Modifier and Type | Field and Description |
---|---|
protected FieldComparator<?>[] |
comparators |
protected SortField[] |
fields
Stores the sort criteria being used.
|
protected int[] |
reverseMul |
Modifier and Type | Method and Description |
---|---|
static <T extends FieldValueHitQueue.Entry> |
create(SortField[] fields,
int size)
Creates a hit queue sorted by the given list of fields.
|
FieldComparator<?>[] |
getComparators() |
int[] |
getReverseMul() |
protected abstract boolean |
lessThan(FieldValueHitQueue.Entry a,
FieldValueHitQueue.Entry b)
Determines the ordering of objects in this priority queue.
|
add, clear, getHeapArray, getSentinelObject, initialize, insertWithOverflow, pop, size, top, updateTop
protected final SortField[] fields
protected final FieldComparator<?>[] comparators
protected final int[] reverseMul
public static <T extends FieldValueHitQueue.Entry> FieldValueHitQueue<T> create(SortField[] fields, int size) throws IOException
NOTE: The instances returned by this method
pre-allocate a full array of length numHits
.
fields
- SortField array we are sorting by in priority order (highest
priority first); cannot be null
or emptysize
- The number of hits to retain. Must be greater than zero.IOException
public FieldComparator<?>[] getComparators()
public int[] getReverseMul()
protected abstract boolean lessThan(FieldValueHitQueue.Entry a, FieldValueHitQueue.Entry b)
PriorityQueue
lessThan
in class PriorityQueue<T extends FieldValueHitQueue.Entry>
true
iff parameter a is less than parameter b.