public class CompoundIterator
extends java.lang.Object
implements java.util.Iterator
| Modifier and Type | Field and Description |
|---|---|
protected int |
index
The index of the current iterator.
|
protected java.util.Iterator[] |
iters
The array of iterators to iterate over.
|
| Constructor and Description |
|---|
CompoundIterator(java.util.Iterator[] iters)
Construct a CompoundIterator over the given array of iterators.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext()
Check if there are more elements.
|
java.lang.Object |
next()
Return the next element from the current iterator.
|
void |
remove()
Remove the current element from the current iterator.
|
protected final java.util.Iterator[] iters
protected int index
public CompoundIterator(java.util.Iterator[] iters)
iters - Array of iterators to iterate over.java.lang.IllegalArgumentException - Array is public boolean hasNext()
hasNext in interface java.util.Iteratorpublic java.lang.Object next()
next in interface java.util.Iteratorjava.util.NoSuchElementException - There are no more elements.public void remove()
remove in interface java.util.Iteratorjava.lang.IllegalStateExceptionjava.lang.UnsupportedOperationException