public class IteratorChain<E>
extends java.lang.Object
implements java.util.Iterator<E>
| Modifier and Type | Field and Description |
|---|---|
private java.util.Iterator<E> |
current |
private java.util.List<java.util.Iterator<E>> |
iterators |
private java.util.Iterator<java.util.Iterator<E>> |
itit |
| Constructor and Description |
|---|
IteratorChain() |
| Modifier and Type | Method and Description |
|---|---|
void |
addIterator(java.util.Iterator<E> it) |
boolean |
hasNext() |
E |
next()
hasNext() must ALWAYS be called before calling this
otherwise it's a bit hard to keep track of what's happening
|
private boolean |
recursiveHasNext()
test if current iterator hasNext(), and if not try the next
one in sequence, recursively
|
void |
remove() |
private final java.util.List<java.util.Iterator<E>> iterators
private java.util.Iterator<java.util.Iterator<E>> itit
private java.util.Iterator<E> current
public void addIterator(java.util.Iterator<E> it)
public boolean hasNext()
hasNext in interface java.util.Iterator<E>private boolean recursiveHasNext()
public E next()
next in interface java.util.Iterator<E>public void remove()
remove in interface java.util.Iterator<E>