|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.jxpath.ri.compiler.Expression
public abstract class Expression
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.
Nested Class Summary | |
---|---|
static class |
Expression.PointerIterator
Pointer iterator |
static class |
Expression.ValueIterator
Value Iterator |
Field Summary | |
---|---|
protected static java.lang.Double |
NOT_A_NUMBER
NaN |
protected static java.lang.Double |
ONE
one |
protected static java.lang.Double |
ZERO
zero |
Constructor Summary | |
---|---|
Expression()
|
Method Summary | |
---|---|
abstract java.lang.Object |
compute(EvalContext context)
Evaluates the expression. |
abstract boolean |
computeContextDependent()
Implemented by subclasses and result is cached by isContextDependent() |
abstract java.lang.Object |
computeValue(EvalContext context)
Evaluates the expression. |
boolean |
isContextDependent()
Returns true if this expression should be re-evaluated each time the current position in the context changes. |
java.util.Iterator |
iterate(EvalContext context)
Iterate over the values from the specified context. |
java.util.Iterator |
iteratePointers(EvalContext context)
Iterate over the pointers from the specified context. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.Double ZERO
protected static final java.lang.Double ONE
protected static final java.lang.Double NOT_A_NUMBER
Constructor Detail |
---|
public Expression()
Method Detail |
---|
public boolean isContextDependent()
public abstract boolean computeContextDependent()
public abstract java.lang.Object computeValue(EvalContext context)
context
- evaluation context
public abstract java.lang.Object compute(EvalContext context)
context
- evaluation context
public java.util.Iterator iterate(EvalContext context)
context
- evaluation context
public java.util.Iterator iteratePointers(EvalContext context)
context
- evaluation context
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |