Package org.jaxen.util
Class AncestorOrSelfAxisIterator
- java.lang.Object
-
- org.jaxen.util.AncestorOrSelfAxisIterator
-
- All Implemented Interfaces:
java.util.Iterator
- Direct Known Subclasses:
AncestorAxisIterator
public class AncestorOrSelfAxisIterator extends java.lang.Object implements java.util.Iterator
Represents the XPath
ancestor-or-self
axis. The "ancestor-or-self
axis contains the context node and the ancestors of the context node; thus, the ancestor axis will always include the root node."- Version:
- 1.2b12
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Object
contextNode
private Navigator
navigator
-
Constructor Summary
Constructors Constructor Description AncestorOrSelfAxisIterator(java.lang.Object contextNode, Navigator navigator)
Create a newancestor-or-self
axis iterator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
Returns true if there are any nodes remaining on the ancestor-or-self axis; false otherwise.java.lang.Object
next()
Returns the next ancestor-or-self node.void
remove()
This operation is not supported.
-
-
-
Field Detail
-
contextNode
private java.lang.Object contextNode
-
navigator
private Navigator navigator
-
-
Constructor Detail
-
AncestorOrSelfAxisIterator
public AncestorOrSelfAxisIterator(java.lang.Object contextNode, Navigator navigator)
Create a newancestor-or-self
axis iterator.- Parameters:
contextNode
- the node to start fromnavigator
- the object model specific navigator
-
-
Method Detail
-
hasNext
public boolean hasNext()
Returns true if there are any nodes remaining on the ancestor-or-self axis; false otherwise.- Specified by:
hasNext
in interfacejava.util.Iterator
- Returns:
- true if any ancestors or self remain
- See Also:
Iterator.hasNext()
-
next
public java.lang.Object next()
Returns the next ancestor-or-self node.- Specified by:
next
in interfacejava.util.Iterator
- Returns:
- the next ancestor-or-self node
- Throws:
java.util.NoSuchElementException
- if no ancestors remain- See Also:
Iterator.next()
-
remove
public void remove()
This operation is not supported.- Specified by:
remove
in interfacejava.util.Iterator
- Throws:
java.lang.UnsupportedOperationException
- always
-
-