com.caucho.xpath.pattern
Class AxisIterator

java.lang.Object
  extended by com.caucho.xpath.pattern.NodeIterator
      extended by com.caucho.xpath.pattern.AxisIterator
All Implemented Interfaces:
ExprEnvironment, java.util.Iterator<org.w3c.dom.Node>
Direct Known Subclasses:
AttributeIterator

public class AxisIterator
extends NodeIterator

Uses the axis to select new nodes.


Field Summary
protected  AbstractPattern _axis
           
protected  org.w3c.dom.Node _lastNode
           
protected  AbstractPattern _match
           
protected  org.w3c.dom.Node _next
           
protected  org.w3c.dom.Node _node
           
protected  NodeIterator _parentIter
           
 
Fields inherited from class com.caucho.xpath.pattern.NodeIterator
_contextNode, _env, _position, _size, log
 
Constructor Summary
protected AxisIterator(ExprEnvironment env)
           
  AxisIterator(NodeIterator parentIter, AbstractPattern axis, org.w3c.dom.Node node, ExprEnvironment env, AbstractPattern match)
          Creates the new AxisIterator.
 
Method Summary
 java.lang.Object clone()
          clones the iterator
 int getContextSize()
          Returns the number of nodes in the context list.
 boolean hasNext()
          True if there's more data.
 org.w3c.dom.Node nextNode()
          Returns the next selected node.
 java.lang.String toString()
           
 
Methods inherited from class com.caucho.xpath.pattern.NodeIterator
copy, getContextNode, getContextPosition, getCurrentNode, getFunction, getOwnerDocument, getPositionIndex, getStylesheetEnv, getVar, next, nextSelectedNode, remove, setContextNode, setMorePositions, stringValue, systemProperty
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_parentIter

protected NodeIterator _parentIter

_axis

protected AbstractPattern _axis

_node

protected org.w3c.dom.Node _node

_next

protected org.w3c.dom.Node _next

_lastNode

protected org.w3c.dom.Node _lastNode

_match

protected AbstractPattern _match
Constructor Detail

AxisIterator

protected AxisIterator(ExprEnvironment env)

AxisIterator

public AxisIterator(NodeIterator parentIter,
                    AbstractPattern axis,
                    org.w3c.dom.Node node,
                    ExprEnvironment env,
                    AbstractPattern match)
             throws XPathException
Creates the new AxisIterator.

Parameters:
parentIter - the parent iterator
axis - the owning axis
node - the first node
env - the variable environment
match - the node matching pattern
Throws:
XPathException
Method Detail

hasNext

public boolean hasNext()
True if there's more data.

Specified by:
hasNext in interface java.util.Iterator<org.w3c.dom.Node>
Specified by:
hasNext in class NodeIterator

nextNode

public org.w3c.dom.Node nextNode()
                          throws XPathException
Returns the next selected node.

Specified by:
nextNode in class NodeIterator
Throws:
XPathException

getContextSize

public int getContextSize()
Returns the number of nodes in the context list.

Specified by:
getContextSize in interface ExprEnvironment
Overrides:
getContextSize in class NodeIterator

clone

public java.lang.Object clone()
Description copied from class: NodeIterator
clones the iterator

Specified by:
clone in class NodeIterator

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object