Class TraversingIterator
java.lang.Object
org.codehaus.commons.compiler.util.iterator.TraversingIterator
An
Iterator
that iterates over a delegate, and while it encounters an array, a Collection
, an Enumeration
or a Iterator
element, it iterates over it
recursively.
Be aware that hasNext()
must read ahead one element.
-
Field Details
-
nest
-
nextElement
-
nextElementRead
private boolean nextElementRead
-
-
Constructor Details
-
TraversingIterator
-
-
Method Details
-
hasNext
public boolean hasNext() -
next
-
readNext
private boolean readNext()Reads the next element and stores it innextElement
.- Returns:
false
if no more element can be read
-
remove
public void remove()- Specified by:
remove
in interfaceIterator<Object>
- Throws:
UnsupportedOperationException
- TheIterator
currently being traversed doesn't support element removal- See Also:
-