Class SuggestWordQueue

    • Constructor Detail

      • SuggestWordQueue

        public SuggestWordQueue​(int size)
        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.