Given two Iterator instances A and B, the
next method on this iterator will switch between A.next()
and B.next() until both iterators are exhausted.
| Modifier and Type | Field and Description |
|---|---|
| private final Iterator | |
| private Iterator | lastReturned
The last iterator which was used for next(). |
| private Iterator | nextIterator
The next iterator to use for next(). |
| Access | Constructor and Description |
|---|---|
| public | ZippingIterator(final Iterator<? extends E>
the first child iterator a, final Iterator<? extends E> the second child iterator b)Constructs a new |
| public | ZippingIterator(final Iterator<? extends E>
the first child iterator a, final Iterator<? extends E> the second child iterator b, final Iterator<? extends E> the third child iterator c)Constructs a new |
| public | ZippingIterator(final Iterator<? extends E>...
the array of iterators iterators)Constructs a new |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if this iterator has remaining elementsImplements java. true if any child iterator has remaining elements.
|
| public E | Returns: the next interleaved elementImplements java. |
| public void | remove()
Overrides default java. |
| iterators | back to summary |
|---|---|
| private final Iterator<Iterator<? extends E>> iterators The | |
| lastReturned | back to summary |
|---|---|
| private Iterator<? extends E> lastReturned The last iterator which was used for next(). | |
| nextIterator | back to summary |
|---|---|
| private Iterator<? extends E> nextIterator The next iterator to use for next(). | |
| ZippingIterator | back to summary |
|---|---|
| public ZippingIterator(final Iterator<? extends E> a, final Iterator<? extends E> b) Constructs a new
| |
| ZippingIterator | back to summary |
|---|---|
| public ZippingIterator(final Iterator<? extends E> a, final Iterator<? extends E> b, final Iterator<? extends E> c) Constructs a new
| |
| ZippingIterator | back to summary |
|---|---|
| public ZippingIterator(final Iterator<? extends E>... iterators) Constructs a new
| |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements java. Returns
| |
| next | back to summary |
|---|---|
| public E next() throws NoSuchElementException Implements java. Returns the next element from a child iterator.
| |
| remove | back to summary |
|---|---|
| public void remove() Overrides default java. Removes the last returned element from the child iterator that produced it.
| |