org.apache.lucene.search.spell

## Class SuggestWordQueue

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

- All Implemented Interfaces:
    Iterable<SuggestWord>

      public final class SuggestWordQueue
      extends PriorityQueue<SuggestWord>

  Sorts SuggestWord instances
  See Also:
    `SuggestWordScoreComparator`, `SuggestWordFrequencyComparator`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Comparator<SuggestWord>` | `DEFAULT_COMPARATOR` Default comparator: score then frequency.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `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

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected boolean` | `lessThan(SuggestWord wa, SuggestWord wb)`

    - ### Methods inherited from class org.apache.lucene.util.PriorityQueue

      `add, clear, getHeapArray, insertWithOverflow, iterator, pop, remove, size, top, updateTop, updateTop`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface java.lang.Iterable

      `forEach, spliterator`

- - ### Field Detail

    - #### DEFAULT_COMPARATOR

          public static final Comparator<SuggestWord> DEFAULT_COMPARATOR

      Default comparator: score then frequency.
      See Also:
        `SuggestWordScoreComparator`

  - ### 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)

      Specified by:
        `lessThan` in class `PriorityQueue<SuggestWord>`

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