org.entityfs.support.util
Class AggregatingIterator<T>
java.lang.Object
org.entityfs.support.util.AggregatingIterator<T>
- All Implemented Interfaces:
- Iterator<T>
public class AggregatingIterator<T>
- extends Object
- implements Iterator<T>
This is an iterator that returns elements from a collection of iterators. The
elements from the first iterator returned from the collection are returned
first, the elements from the second iterator next, etc.
EntityFS iterators are not thread safe. Don't use them concurrently from
several threads without synchronizing access to them.
- Since:
- 1.0
- Author:
- Karl Gustafsson
- In_jar:
- entityfs-core
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AggregatingIterator
public AggregatingIterator(Collection<? extends Iterator<? extends T>> itrs)
- Create an iterator that aggregates the elements from the supplied
iterators. The iterators are run in the order that they are returned when
iterating over the supplied collection.
- Parameters:
itrs
- The iterators.
AggregatingIterator
public AggregatingIterator(Iterator<? extends T>... itrs)
- Create an iterator that aggregates the elements from the supplied
iterators.
- Parameters:
itrs
- The iterators.
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interface Iterator<T>
next
public T next()
- Specified by:
next
in interface Iterator<T>
remove
public void remove()
- Specified by:
remove
in interface Iterator<T>