org.inria.ns.reflex.xml.xpath.axes
Class AncestorOrSelfAxisIterator

java.lang.Object
  extended by org.inria.ns.reflex.xml.xpath.axes.AncestorOrSelfAxisIterator
All Implemented Interfaces:
Iterator
Direct Known Subclasses:
AncestorAxisIterator

public class AncestorOrSelfAxisIterator
extends Object
implements Iterator

An implementation of the XPath ancestor or self axis. This class is based on Jaxen, but is independant of a given Jaxen navigator.

Author:
Philippe Poulard

Constructor Summary
AncestorOrSelfAxisIterator(Object contextNode)
          Create a new ancestor-or-self axis iterator.
 
Method Summary
 boolean hasNext()
          Returns true if there are any nodes remaining on the ancestor-or-self axis; false otherwise.
 Object next()
          Returns the next ancestor-or-self node.
 void remove()
          This operation is not supported.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AncestorOrSelfAxisIterator

public AncestorOrSelfAxisIterator(Object contextNode)
Create a new ancestor-or-self axis iterator.

Parameters:
contextNode - the node to start from
navigator - 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 interface Iterator
Returns:
true if any ancestors or self remain
See Also:
Iterator.hasNext()

next

public Object next()
Returns the next ancestor-or-self node.

Specified by:
next in interface Iterator
Returns:
the next ancestor-or-self node
Throws:
NoSuchElementException - if no ancestors remain
See Also:
Iterator.next()

remove

public void remove()
This operation is not supported.

Specified by:
remove in interface Iterator
Throws:
UnsupportedOperationException - always