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.3 $ $Date: 2002/05/08 00:39:59 $
- Author:
- Dmitri Plotnikov
Constructor Summary |
protected |
Expression(int typeCode)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
OP_SUM
public static final int OP_SUM
- See Also:
- Constant Field Values
OP_MINUS
public static final int OP_MINUS
- See Also:
- Constant Field Values
OP_MULT
public static final int OP_MULT
- See Also:
- Constant Field Values
OP_DIV
public static final int OP_DIV
- See Also:
- Constant Field Values
OP_CONSTANT
public static final int OP_CONSTANT
- See Also:
- Constant Field Values
OP_STEP
public static final int OP_STEP
- See Also:
- Constant Field Values
OP_AND
public static final int OP_AND
- See Also:
- Constant Field Values
OP_OR
public static final int OP_OR
- See Also:
- Constant Field Values
OP_UNARY_MINUS
public static final int OP_UNARY_MINUS
- See Also:
- Constant Field Values
OP_MOD
public static final int OP_MOD
- See Also:
- Constant Field Values
OP_LT
public static final int OP_LT
- See Also:
- Constant Field Values
OP_GT
public static final int OP_GT
- See Also:
- Constant Field Values
OP_LTE
public static final int OP_LTE
- See Also:
- Constant Field Values
OP_GTE
public static final int OP_GTE
- See Also:
- Constant Field Values
OP_EQ
public static final int OP_EQ
- See Also:
- Constant Field Values
OP_NE
public static final int OP_NE
- See Also:
- Constant Field Values
OP_VAR
public static final int OP_VAR
- See Also:
- Constant Field Values
OP_FUNCTION
public static final int OP_FUNCTION
- See Also:
- Constant Field Values
OP_UNION
public static final int OP_UNION
- See Also:
- Constant Field Values
OP_LOCATION_PATH
public static final int OP_LOCATION_PATH
- See Also:
- Constant Field Values
OP_EXPRESSION_PATH
public static final int OP_EXPRESSION_PATH
- See Also:
- Constant Field Values
OP_CORE_FUNCTION
public static final int OP_CORE_FUNCTION
- See Also:
- Constant Field Values
OP_KEY_LOOKUP
public static final int OP_KEY_LOOKUP
- See Also:
- Constant Field Values
ZERO
protected static java.lang.Double ZERO
ONE
protected static java.lang.Double ONE
NaN
protected static java.lang.Double NaN
Expression
protected Expression(int typeCode)
getExpressionTypeCode
public int getExpressionTypeCode()
getArguments
protected Expression[] getArguments()
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()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
opCodeToString
protected java.lang.String opCodeToString()
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)
Copyright (c) 2001 - Apache Software Foundation