Package com.complexible.common.collect

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

  Constructors
  Constructor
  Description
  `QueuedSortedIterator(com.google.common.collect.PeekingIterator<T> theIt, Comparator<T> theComparator)`
  `QueuedSortedIterator(com.google.common.collect.PeekingIterator<T> theIt, PriorityQueue<T> theQueue)`

- ## Method Summary

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