com.caucho.xpath.pattern
Class FromExpr

java.lang.Object
  extended by com.caucho.xpath.pattern.AbstractPattern
      extended by com.caucho.xpath.pattern.FromExpr

public class FromExpr
extends AbstractPattern

matches if the expression returns a node set and the test-node is contained in that node set.

The code interprets Iterators, ArrayLists, and Nodes as node sets.


Field Summary
 
Fields inherited from class com.caucho.xpath.pattern.AbstractPattern
_child, _parent, log, XMLNS
 
Constructor Summary
FromExpr(AbstractPattern parent, Expr expr)
           
 
Method Summary
 int count(org.w3c.dom.Node node, Env env, AbstractPattern pattern)
          The count is the size of the expression node-set.
 NodeIterator createNodeIterator(org.w3c.dom.Node node, ExprEnvironment env, AbstractPattern match)
          Creates a new node iterator.
 boolean match(org.w3c.dom.Node node, ExprEnvironment env)
          matches if the expression returns a node set and the test-node is contained in that node set.
 int position(org.w3c.dom.Node node, Env env, AbstractPattern pattern)
          The position is the position in the expression node-set.
 java.lang.String toString()
           
 
Methods inherited from class com.caucho.xpath.pattern.AbstractPattern
copyAxis, copyPosition, findAny, firstNode, getNodeName, getParent, getPrefix, getPriority, isAscending, isStrictlyAscending, isUnique, lastNode, nextNode, select, selectUnique, toPatternString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FromExpr

public FromExpr(AbstractPattern parent,
                Expr expr)
Method Detail

match

public boolean match(org.w3c.dom.Node node,
                     ExprEnvironment env)
              throws XPathException
matches if the expression returns a node set and the test-node is contained in that node set.

Specified by:
match in class AbstractPattern
Parameters:
node - the node to test
env - the variable environment.
Returns:
true if the node matches the pattern.
Throws:
XPathException

createNodeIterator

public NodeIterator createNodeIterator(org.w3c.dom.Node node,
                                       ExprEnvironment env,
                                       AbstractPattern match)
                                throws XPathException
Creates a new node iterator.

Overrides:
createNodeIterator in class AbstractPattern
Parameters:
node - the starting node
env - the variable environment
match - the axis match pattern
Returns:
the node iterator
Throws:
XPathException

position

public int position(org.w3c.dom.Node node,
                    Env env,
                    AbstractPattern pattern)
             throws XPathException
The position is the position in the expression node-set.

Overrides:
position in class AbstractPattern
Parameters:
node - the current node
env - the variable environment
pattern - the position pattern
Returns:
the node's position.
Throws:
XPathException

count

public int count(org.w3c.dom.Node node,
                 Env env,
                 AbstractPattern pattern)
          throws XPathException
The count is the size of the expression node-set.

Overrides:
count in class AbstractPattern
Parameters:
node - the current node
env - the variable environment
pattern - the position pattern
Returns:
the count of nodes in the match selection
Throws:
XPathException

toString

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