com.caucho.xpath.pattern
Class NodeIterator

java.lang.Object
  extended by com.caucho.xpath.pattern.NodeIterator
All Implemented Interfaces:
ExprEnvironment, java.util.Iterator<org.w3c.dom.Node>
Direct Known Subclasses:
AttributeListIterator, AxisIterator, FilterIterator, MergeIterator, NamespaceIterator, NodeArrayListIterator, NodeListIterator, SingleNodeIterator, UnionIterator, UniqueIterator

public abstract class NodeIterator
extends java.lang.Object
implements ExprEnvironment, java.util.Iterator<org.w3c.dom.Node>

Iterates through matching nodes.


Field Summary
protected  org.w3c.dom.Node _contextNode
           
protected  ExprEnvironment _env
           
protected  int _position
           
protected  int _size
           
protected static java.util.logging.Logger log
           
 
Constructor Summary
protected NodeIterator(ExprEnvironment env)
           
 
Method Summary
abstract  java.lang.Object clone()
          clones the iterator
 void copy(NodeIterator src)
          copies the iterator.
 org.w3c.dom.Node getContextNode()
          Gets the env node.
 int getContextPosition()
          Returns the position of the context node.
 int getContextSize()
          Returns the number of nodes in the context list.
 org.w3c.dom.Node getCurrentNode()
          Sets the current node.
 XPathFun getFunction(java.lang.String name)
          Returns the given variable
 org.w3c.dom.Document getOwnerDocument()
          Returns a document for creating nodes.
 int getPositionIndex()
          Returns the position index count.
 StylesheetEnv getStylesheetEnv()
          Returns the stylesheet environment.
 Var getVar(java.lang.String name)
          Returns the given variable
abstract  boolean hasNext()
          True if there's more data.
 org.w3c.dom.Node next()
          Iterator interface.
abstract  org.w3c.dom.Node nextNode()
          Returns the next node.
 SelectedNode nextSelectedNode()
          Returns the next selected node.
 void remove()
          remove is unsupported
 org.w3c.dom.Node setContextNode(org.w3c.dom.Node node)
          Sets the env node.
 void setMorePositions(boolean more)
          Set true if should test more positions.
 java.lang.String stringValue(org.w3c.dom.Node node)
          Returns the string-value of the ndoe.
 java.lang.Object systemProperty(java.lang.String namespaceURI, java.lang.String localName)
          Returns the given system property.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final java.util.logging.Logger log

_env

protected ExprEnvironment _env

_contextNode

protected org.w3c.dom.Node _contextNode

_position

protected int _position

_size

protected int _size
Constructor Detail

NodeIterator

protected NodeIterator(ExprEnvironment env)
Method Detail

hasNext

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

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

nextNode

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

Throws:
XPathException

next

public org.w3c.dom.Node next()
Iterator interface.

Specified by:
next in interface java.util.Iterator<org.w3c.dom.Node>

nextSelectedNode

public SelectedNode nextSelectedNode()
                              throws XPathException
Returns the next selected node.

Throws:
XPathException

getCurrentNode

public org.w3c.dom.Node getCurrentNode()
Sets the current node.

Specified by:
getCurrentNode in interface ExprEnvironment

getContextNode

public org.w3c.dom.Node getContextNode()
Gets the env node.

Specified by:
getContextNode in interface ExprEnvironment

setContextNode

public org.w3c.dom.Node setContextNode(org.w3c.dom.Node node)
Sets the env node.

Specified by:
setContextNode in interface ExprEnvironment

getContextPosition

public int getContextPosition()
Returns the position of the context node.

Specified by:
getContextPosition in interface ExprEnvironment

getContextSize

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

Specified by:
getContextSize in interface ExprEnvironment

getOwnerDocument

public org.w3c.dom.Document getOwnerDocument()
Returns a document for creating nodes.

Specified by:
getOwnerDocument in interface ExprEnvironment

getVar

public Var getVar(java.lang.String name)
Returns the given variable

Specified by:
getVar in interface ExprEnvironment

getFunction

public XPathFun getFunction(java.lang.String name)
Returns the given variable

Specified by:
getFunction in interface ExprEnvironment

getStylesheetEnv

public StylesheetEnv getStylesheetEnv()
Returns the stylesheet environment.

Specified by:
getStylesheetEnv in interface ExprEnvironment

systemProperty

public java.lang.Object systemProperty(java.lang.String namespaceURI,
                                       java.lang.String localName)
Returns the given system property.

Specified by:
systemProperty in interface ExprEnvironment

stringValue

public java.lang.String stringValue(org.w3c.dom.Node node)
Returns the string-value of the ndoe.

Specified by:
stringValue in interface ExprEnvironment

getPositionIndex

public int getPositionIndex()
Returns the position index count.


setMorePositions

public void setMorePositions(boolean more)
Set true if should test more positions.


clone

public abstract java.lang.Object clone()
clones the iterator

Overrides:
clone in class java.lang.Object

copy

public void copy(NodeIterator src)
copies the iterator.


remove

public void remove()
            throws java.lang.UnsupportedOperationException
remove is unsupported

Specified by:
remove in interface java.util.Iterator<org.w3c.dom.Node>
Throws:
java.lang.UnsupportedOperationException