public abstract class FieldValueHitQueue<T extends FieldValueHitQueue.Entry> extends PriorityQueue<T>
IndexSearcher.search(Query,int,Sort)
Modifier and Type | Class and Description |
---|---|
static class |
FieldValueHitQueue.Entry
Extension of ScoreDoc to also store the
FieldComparator slot. |
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() |
LeafFieldComparator[] |
getComparators(LeafReaderContext context) |
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, insertWithOverflow, iterator, pop, remove, size, top, updateTop, updateTop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
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
- if there is a low-level IO errorpublic FieldComparator<?>[] getComparators()
public int[] getReverseMul()
public LeafFieldComparator[] getComparators(LeafReaderContext context) throws IOException
IOException
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.Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.