org.apache.lucene.search.spell
Class SuggestWordQueue

java.lang.Object
  extended by org.apache.lucene.util.PriorityQueue<SuggestWord>
      extended by org.apache.lucene.search.spell.SuggestWordQueue

public final class SuggestWordQueue
extends PriorityQueue<SuggestWord>

Sorts SuggestWord instances

See Also:
SuggestWordScoreComparator, SuggestWordFrequencyComparator

Field Summary
static Comparator<SuggestWord> DEFAULT_COMPARATOR
           
 
Constructor Summary
SuggestWordQueue(int size)
          Use the DEFAULT_COMPARATOR
SuggestWordQueue(int size, Comparator<SuggestWord> comparator)
          Specify the size of the queue and the comparator to use for sorting.
 
Method Summary
protected  boolean lessThan(SuggestWord wa, SuggestWord wb)
          Determines the ordering of objects in this priority queue.
 
Methods inherited from class org.apache.lucene.util.PriorityQueue
add, clear, getHeapArray, getSentinelObject, initialize, 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

DEFAULT_COMPARATOR

public static final Comparator<SuggestWord> DEFAULT_COMPARATOR
Constructor Detail

SuggestWordQueue

public SuggestWordQueue(int size)
Use the DEFAULT_COMPARATOR

Parameters:
size - The size of the queue

SuggestWordQueue

public SuggestWordQueue(int size,
                        Comparator<SuggestWord> comparator)
Specify the size of the queue and the comparator to use for sorting.

Parameters:
size - The size
comparator - The comparator.
Method Detail

lessThan

protected final boolean lessThan(SuggestWord wa,
                                 SuggestWord wb)
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<SuggestWord>
Returns:
true iff parameter a is less than parameter b.


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