public class DescendantAxisIterator
extends java.lang.Object
implements java.util.Iterator
descendant
axis.
The "descendant
axis contains the descendants of the context node;
a descendant is a child or a child of a child and so on; thus
the descendant axis never contains attribute or namespace nodes."Modifier and Type | Field and Description |
---|---|
private java.util.Iterator |
children |
private Navigator |
navigator |
private java.util.ArrayList |
stack |
Constructor and Description |
---|
DescendantAxisIterator(Navigator navigator,
java.util.Iterator iterator) |
DescendantAxisIterator(java.lang.Object contextNode,
Navigator navigator)
Create a new
descendant axis iterator. |
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext()
Returns true if there are any descendants remaining; false otherwise.
|
java.lang.Object |
next()
Returns the next descendant node.
|
void |
remove()
This operation is not supported.
|
private java.util.ArrayList stack
private java.util.Iterator children
private Navigator navigator
public DescendantAxisIterator(java.lang.Object contextNode, Navigator navigator) throws UnsupportedAxisException
descendant
axis iterator.contextNode
- the node to start fromnavigator
- the object model specific navigatorUnsupportedAxisException
public DescendantAxisIterator(Navigator navigator, java.util.Iterator iterator)
public boolean hasNext()
hasNext
in interface java.util.Iterator
Iterator.hasNext()
public java.lang.Object next()
next
in interface java.util.Iterator
java.util.NoSuchElementException
- if no descendants remainIterator.next()
public void remove()
remove
in interface java.util.Iterator
java.lang.UnsupportedOperationException
- always