com.caucho.xpath.expr
Class AbstractNumberExpr

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

public abstract class AbstractNumberExpr
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
 
Constructor Summary
AbstractNumberExpr()
           
 
Method Summary
 boolean evalBoolean(org.w3c.dom.Node node, ExprEnvironment env)
          Evaluates the expression as a boolean.
abstract  double evalNumber(org.w3c.dom.Node node, ExprEnvironment env)
          Evaluates the expression as a number.
 java.lang.Object evalObject(org.w3c.dom.Node node, ExprEnvironment env)
          Evaluates the expression as an object.
 java.lang.String evalString(org.w3c.dom.Node node, ExprEnvironment env)
          Evaluates the expression as a string.
 Var evalVar(org.w3c.dom.Node node, ExprEnvironment env)
          Evaluates to a variable.
 boolean isNumber()
          true if the expression prefers to return a number.
 
Methods inherited from class com.caucho.xpath.Expr
addParam, addVar, evalBoolean, evalNodeSet, evalNodeSet, evalNumber, evalObject, evalString, evalString, evalString, getListContext, isBoolean, isNodeSet, isString, setListContext, setVar, stringToNumber, toBoolean, toDouble, toNode, toNodeList, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractNumberExpr

public AbstractNumberExpr()
Method Detail

isNumber

public boolean isNumber()
Description copied from class: Expr
true if the expression prefers to return a number.

Overrides:
isNumber in class Expr

evalVar

public Var evalVar(org.w3c.dom.Node node,
                   ExprEnvironment env)
            throws XPathException
Evaluates to a variable.

Overrides:
evalVar in class Expr
Parameters:
node - the node to evaluate and use as a context.
env - the variable environment.
Returns:
a variable containing the value.
Throws:
XPathException

evalNumber

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

Specified by:
evalNumber in class Expr
Parameters:
node - the node to evaluate and use as a context.
env - the variable environment.
Returns:
the numeric value
Throws:
XPathException

evalBoolean

public boolean evalBoolean(org.w3c.dom.Node node,
                           ExprEnvironment env)
                    throws XPathException
Evaluates the expression as a boolean.

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

evalString

public java.lang.String evalString(org.w3c.dom.Node node,
                                   ExprEnvironment env)
                            throws XPathException
Evaluates the expression as a string.

Specified by:
evalString in class Expr
Parameters:
node - the current node
env - the variable environment.
Returns:
the string representation of the number.
Throws:
XPathException

evalObject

public java.lang.Object evalObject(org.w3c.dom.Node node,
                                   ExprEnvironment env)
                            throws XPathException
Evaluates the expression as an object.

Specified by:
evalObject in class Expr
Parameters:
node - the current node
env - the variable environment.
Returns:
the Double representation of the number.
Throws:
XPathException