Package org.jboss.util.collection
Class CompoundIterator
- java.lang.Object
-
- org.jboss.util.collection.CompoundIterator
-
- All Implemented Interfaces:
java.util.Iterator
public class CompoundIterator extends java.lang.Object implements java.util.Iterator
A compound iterator, which iterates over all of the elements in the given iterators.- Version:
- $Revision$
-
-
Constructor Summary
Constructors Constructor Description CompoundIterator(java.util.Iterator[] iters)
Construct a CompoundIterator over the given array of iterators.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Method Detail
-
hasNext
public boolean hasNext()
Check if there are more elements.- Specified by:
hasNext
in interfacejava.util.Iterator
- Returns:
- True if there are more elements.
-
next
public java.lang.Object next()
Return the next element from the current iterator.- Specified by:
next
in interfacejava.util.Iterator
- Returns:
- The next element from the current iterator.
- Throws:
java.util.NoSuchElementException
- There are no more elements.
-
remove
public void remove()
Remove the current element from the current iterator.- Specified by:
remove
in interfacejava.util.Iterator
- Throws:
java.lang.IllegalStateException
java.lang.UnsupportedOperationException
-
-