org.apache.commons.jxpath.ri.compiler
Class Expression
java.lang.Object
org.apache.commons.jxpath.ri.compiler.Expression
public abstract class Expression
extends java.lang.Object
Common superclass for several types of nodes in the parse tree. Provides
APIs for optimization of evaluation of expressions. Specifically, an
expression only needs to executed once during the evaluation of an xpath
if that expression is context-independent. Expression.isContextDependent()
provides that hint.
$Revision: 1.10 $ $Date: 2004/02/29 14:17:38 $
NOT_A_NUMBER
protected static final Double NOT_A_NUMBER
ONE
protected static final Double ONE
ZERO
protected static final Double ZERO
compute
public abstract Object compute(EvalContext context)
computeContextDependent
public abstract boolean computeContextDependent()
Implemented by subclasses and result is cached by isContextDependent()
computeValue
public abstract Object computeValue(EvalContext context)
Evaluates the expression. If the result is a node set, returns
the first element of the node set.
isContextDependent
public boolean isContextDependent()
Returns true if this expression should be re-evaluated
each time the current position in the context changes.
iteratePointers
public Iterator iteratePointers(EvalContext context)