com.caucho.xpath.expr
Class NodeSetExpr

java.lang.Object
  extended by com.caucho.xpath.Expr
      extended by com.caucho.xpath.expr.NodeSetExpr

public class NodeSetExpr
extends Expr


Field Summary
 
Fields inherited from class com.caucho.xpath.Expr
ADD, AND, ATTRIBUTE, BASE_URI, BOOLEAN, BOOLEAN_EQ, BOOLEAN_NEQ, CEILING, CONCAT, CONST, CONTAINS, COUNT, DIV, ELEMENT, EQ, FALSE, FLOOR, FORMAT_NUMBER, FUNCTION_AVAILABLE, GE, GENERATE_ID, GT, ID, IF, LANG, LAST, LAST_FUN, LE, LOCAL_PART, LT, MOD, MUL, NAMESPACE, NEG, NEQ, NODE_SET, NORMALIZE, NOT, NUMBER, NUMBER_EQ, NUMBER_GE, NUMBER_GT, NUMBER_LE, NUMBER_LT, NUMBER_NEQ, OR, POSITION, QNAME, QUO, ROUND, SELF, SELF_NAME, STARTS_WITH, STRING, STRING_EQ, STRING_LENGTH, STRING_NEQ, SUB, SUBSTRING, SUBSTRING_AFTER, SUBSTRING_BEFORE, SUM, SYSTEM_PROPERTY, TRANSLATE, TRUE
 
Method Summary
static Expr create(AbstractPattern pattern)
          Creates an expr, handling some special cases.
 boolean equals(java.lang.Object b)
           
 boolean evalBoolean(org.w3c.dom.Node node, ExprEnvironment env)
          Returns true if there are any patterns matching the pattern.
 NodeIterator evalNodeSet(org.w3c.dom.Node node, ExprEnvironment env)
          Evaluate a node-set object, returning an iterator of the node set.
 double evalNumber(org.w3c.dom.Node node, ExprEnvironment env)
          Returns the value of the expression as a number.
 java.lang.Object evalObject(org.w3c.dom.Node node, ExprEnvironment env)
          Evaluate a node-set object, returning an ArrayList of the node set.
 java.lang.String evalString(org.w3c.dom.Node node, ExprEnvironment env)
          Returns the value of the node set expression as a string.
 AbstractPattern getPattern()
          Returns the underlying pattern.
 boolean isNodeSet()
          NodeSetExprs prefer to be node sets.
protected  AbstractPattern toNodeList()
          Convert from an expression to a pattern.
 java.lang.String toString()
           
 
Methods inherited from class com.caucho.xpath.Expr
addParam, addVar, evalBoolean, evalNodeSet, evalNumber, evalObject, evalString, evalString, evalString, evalVar, getListContext, isBoolean, isNumber, isString, setListContext, setVar, stringToNumber, toBoolean, toDouble, toNode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

create

public static Expr create(AbstractPattern pattern)
Creates an expr, handling some special cases.


getPattern

public AbstractPattern getPattern()
Returns the underlying pattern.


isNodeSet

public boolean isNodeSet()
NodeSetExprs prefer to be node sets.

Overrides:
isNodeSet in class Expr

evalNumber

public double evalNumber(org.w3c.dom.Node node,
                         ExprEnvironment env)
                  throws XPathException
Returns the value of the expression as a number.

Specified by:
evalNumber in class Expr
Parameters:
node - the current node
env - the variable environment.
Returns:
the numeric value.
Throws:
XPathException

evalBoolean

public boolean evalBoolean(org.w3c.dom.Node node,
                           ExprEnvironment env)
                    throws XPathException
Returns true if there are any patterns matching the pattern.

Specified by:
evalBoolean in class Expr
Parameters:
node - the current node
env - the variable environment.
Returns:
the boolean value.
Throws:
XPathException

evalString

public java.lang.String evalString(org.w3c.dom.Node node,
                                   ExprEnvironment env)
                            throws XPathException
Returns the value of the node set expression as a string. The value is the text value of the first node.

Specified by:
evalString in class Expr
Parameters:
node - the current node
env - the variable environment
Returns:
the combined text value of the node.
Throws:
XPathException

evalObject

public java.lang.Object evalObject(org.w3c.dom.Node node,
                                   ExprEnvironment env)
                            throws XPathException
Evaluate a node-set object, returning an ArrayList of the node set.

Specified by:
evalObject in class Expr
Parameters:
node - the current node
env - the variable environment
Returns:
an array list of the nodes
Throws:
XPathException

evalNodeSet

public NodeIterator evalNodeSet(org.w3c.dom.Node node,
                                ExprEnvironment env)
                         throws XPathException
Evaluate a node-set object, returning an iterator of the node set.

Overrides:
evalNodeSet in class Expr
Parameters:
node - the current node
env - the variable environment
Returns:
an iterator of the nodes
Throws:
XPathException

toNodeList

protected AbstractPattern toNodeList()
Convert from an expression to a pattern.

Overrides:
toNodeList in class Expr

equals

public boolean equals(java.lang.Object b)
Overrides:
equals in class java.lang.Object

toString

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