org.apache.commons.jxpath.ri.compiler
Class Expression
java.lang.Object
org.apache.commons.jxpath.ri.compiler.Expression
- Direct Known Subclasses:
- Constant, Operation, Path, VariableReference
- 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.
- Version:
- $Revision: 1.10 $ $Date: 2004/02/29 14:17:38 $
- Author:
- Dmitri Plotnikov
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ZERO
protected static final java.lang.Double ZERO
ONE
protected static final java.lang.Double ONE
NOT_A_NUMBER
protected static final java.lang.Double NOT_A_NUMBER
contextDependencyKnown
private boolean contextDependencyKnown
contextDependent
private boolean contextDependent
Expression
public Expression()
isContextDependent
public boolean isContextDependent()
- Returns true if this expression should be re-evaluated
each time the current position in the context changes.
computeContextDependent
public abstract boolean computeContextDependent()
- Implemented by subclasses and result is cached by isContextDependent()
computeValue
public abstract java.lang.Object computeValue(EvalContext context)
- Evaluates the expression. If the result is a node set, returns
the first element of the node set.
compute
public abstract java.lang.Object compute(EvalContext context)
iterate
public java.util.Iterator iterate(EvalContext context)
iteratePointers
public java.util.Iterator iteratePointers(EvalContext context)