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