java.lang.ObjectDescendantIterator
class DescendantIterator
Traverse all a parent's descendants (all children at any level below the parent).
Field Summary | |
---|---|
private static java.lang.String |
CVS_ID
|
private java.util.Iterator |
iterator
|
private java.util.Iterator |
nextIterator
|
private java.util.List |
stack
|
Constructor Summary | |
---|---|
DescendantIterator(Parent parent)
Iterator for the descendants of the supplied object. |
Method Summary | |
---|---|
boolean |
hasNext()
Returns true> if the iteration has more Content descendants. |
java.lang.Object |
next()
Returns the next Content descendant. |
private java.util.Iterator |
pop()
|
private void |
push(java.util.Iterator itr)
|
void |
remove()
Detaches the last Content returned by the last call to
next from it's parent. |
private boolean |
stackHasAnyNext()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.Iterator iterator
private java.util.Iterator nextIterator
private java.util.List stack
private static final java.lang.String CVS_ID
Constructor Detail |
---|
DescendantIterator(Parent parent)
parent
- document or element whose descendants will be iteratedMethod Detail |
---|
public boolean hasNext()
Content
descendants.
hasNext
in interface java.util.Iterator
public java.lang.Object next()
Content
descendant.
next
in interface java.util.Iterator
public void remove()
Content
returned by the last call to
next from it's parent. Note: this does not affect
iteration and all children, siblings, and any node following the
removed node (in document order) will be visited.
remove
in interface java.util.Iterator
private java.util.Iterator pop()
private void push(java.util.Iterator itr)
private boolean stackHasAnyNext()