Class QueuedSortedIterator<T>

  • All Implemented Interfaces:
    java.util.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 Summary

      Constructors 
      Constructor Description
      QueuedSortedIterator​(com.google.common.collect.PeekingIterator<T> theIt, java.util.Comparator<T> theComparator)  
      QueuedSortedIterator​(com.google.common.collect.PeekingIterator<T> theIt, java.util.PriorityQueue<T> theQueue)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(T theElement)  
      boolean hasNext()  
      T next()  
      • Methods inherited from class com.google.common.collect.UnmodifiableIterator

        remove
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Iterator

        forEachRemaining
    • Constructor Detail

      • QueuedSortedIterator

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

        public QueuedSortedIterator​(com.google.common.collect.PeekingIterator<T> theIt,
                                    java.util.PriorityQueue<T> theQueue)
    • Method Detail

      • add

        public void add​(T theElement)
      • hasNext

        public boolean hasNext()
      • next

        public T next()