|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.util.PriorityQueue<T> org.apache.lucene.search.FieldValueHitQueue<T>
public abstract class FieldValueHitQueue<T extends FieldValueHitQueue.Entry>
Expert: A hit queue for sorting by hits by terms in more than one field.
Uses FieldCache.DEFAULT
for maintaining
internal term lookup tables.
IndexSearcher.search(Query,Filter,int,Sort)
,
FieldCache
Nested Class Summary | |
---|---|
static class |
FieldValueHitQueue.Entry
Extension of ScoreDoc to also store the FieldComparator slot. |
Field Summary | |
---|---|
protected FieldComparator<?>[] |
comparators
|
protected SortField[] |
fields
Stores the sort criteria being used. |
protected FieldComparator<?> |
firstComparator
|
protected int[] |
reverseMul
|
Method Summary | ||
---|---|---|
static
|
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. |
|
void |
setComparator(int pos,
FieldComparator<?> comparator)
|
Methods inherited from class org.apache.lucene.util.PriorityQueue |
---|
add, clear, getHeapArray, getSentinelObject, insertWithOverflow, pop, size, top, updateTop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final SortField[] fields
protected final FieldComparator<?>[] comparators
protected FieldComparator<?> firstComparator
protected final int[] reverseMul
Method Detail |
---|
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 void setComparator(int pos, FieldComparator<?> comparator)
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |