Class FieldValueHitQueue

  extended by org.apache.lucene.util.PriorityQueue
      extended by

public abstract class FieldValueHitQueue
extends PriorityQueue

Expert: A hit queue for sorting by hits by terms in more than one field. Uses FieldCache.DEFAULT for maintaining internal term lookup tables. This class will not resolve SortField.AUTO types, and expects the type of all SortFields used for construction to already have been resolved. SortField.detectFieldType(IndexReader, String) is a utility method which may be used for field type detection. NOTE: This API is experimental and might change in incompatible ways in the next release.

See Also:,Filter,int,Sort), FieldCache

Field Summary
protected  FieldComparator[] comparators
protected  SortField[] fields
          Stores the sort criteria being used.
protected  int[] reverseMul
Fields inherited from class org.apache.lucene.util.PriorityQueue
Method Summary
static FieldValueHitQueue create(SortField[] fields, int size)
          Creates a hit queue sorted by the given list of fields.
protected abstract  boolean lessThan(Object a, Object b)
          Determines the ordering of objects in this priority queue.
Methods inherited from class org.apache.lucene.util.PriorityQueue
add, adjustTop, clear, getSentinelObject, initialize, insert, insertWithOverflow, pop, put, 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
Stores the sort criteria being used.


protected final FieldComparator[] comparators


protected final int[] reverseMul
Method Detail


public static FieldValueHitQueue create(SortField[] fields,
                                        int size)
                                 throws IOException
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.

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 abstract boolean lessThan(Object a,
                                    Object 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 class PriorityQueue

Copyright © 2000-2010 Apache Software Foundation. All Rights Reserved.