Class TraversingIterator
- java.lang.Object
-
- org.codehaus.commons.compiler.util.iterator.TraversingIterator
-
- All Implemented Interfaces:
java.util.Iterator<java.lang.Object>
public class TraversingIterator extends java.lang.Object implements java.util.Iterator<java.lang.Object>
AnIterator
that iterates over a delegate, and while it encounters an array, aCollection
, anEnumeration
or aIterator
element, it iterates over it recursively.Be aware that
hasNext()
must read ahead one element.
-
-
Constructor Summary
Constructors Constructor Description TraversingIterator(java.util.Iterator<?> delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
java.lang.Object
next()
void
remove()
-
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator<java.lang.Object>
-
next
public java.lang.Object next()
- Specified by:
next
in interfacejava.util.Iterator<java.lang.Object>
-
remove
public void remove()
- Specified by:
remove
in interfacejava.util.Iterator<java.lang.Object>
- Throws:
java.lang.UnsupportedOperationException
- TheIterator
currently being traversed doesn't support element removal- See Also:
Iterator.remove()
-
-