|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmessif.utility.SortingIterator<T>
T
- type of objects provided by the encapsulated collection of iteratorspublic class SortingIterator<T>
Iterator that retrieves the smallest object from a collection of iterators when
its next
method is called.
Field Summary | |
---|---|
protected java.util.Comparator<? super T> |
comparator
The comparator used to sort the provided objects |
Constructor Summary | |
---|---|
SortingIterator(java.util.Collection<? extends java.util.Iterator<? extends T>> iterators,
java.util.Comparator<? super T> comparator)
Creates a new instance of SortingIterator. |
Method Summary | |
---|---|
boolean |
hasNext()
|
T |
next()
|
void |
remove()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final java.util.Comparator<? super T> comparator
Constructor Detail |
---|
public SortingIterator(java.util.Collection<? extends java.util.Iterator<? extends T>> iterators, java.util.Comparator<? super T> comparator)
iterators
- the collection of iterators to get the objects fromcomparator
- the comparator used to sort the objects provided by iteratorsMethod Detail |
---|
public boolean hasNext()
hasNext
in interface java.util.Iterator<T>
public T next()
next
in interface java.util.Iterator<T>
public void remove()
remove
in interface java.util.Iterator<T>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |