Class QueuedSortedIterator<T>

java.lang.Object
com.google.common.collect.UnmodifiableIterator<T>
com.complexible.common.collect.QueuedSortedIterator<T>
All Implemented Interfaces:
Iterator<T>

public class QueuedSortedIterator<T> extends com.google.common.collect.UnmodifiableIterator<T>
A sorted iterator wrapper to which elements can be added dynamically. Added element will be available to next() function in the correct order. Elements can be added in any order and may even be less than the elements that are already returned by the iterator though that will make the overall iteration unsorted.
Since:
2.e
Version:
2.e
Author:
Evren Sirin
  • Constructor Details

    • QueuedSortedIterator

      public QueuedSortedIterator(com.google.common.collect.PeekingIterator<T> theIt, Comparator<T> theComparator)
    • QueuedSortedIterator

      public QueuedSortedIterator(com.google.common.collect.PeekingIterator<T> theIt, PriorityQueue<T> theQueue)
  • Method Details

    • add

      public void add(T theElement)
    • hasNext

      public boolean hasNext()
    • next

      public T next()