org.apache.commons.jxpath.ri.compiler
Class CoreOperation
java.lang.Object
|
+--org.apache.commons.jxpath.ri.compiler.Expression
|
+--org.apache.commons.jxpath.ri.compiler.Operation
|
+--org.apache.commons.jxpath.ri.compiler.CoreOperation
- Direct Known Subclasses:
- CoreOperationAdd, CoreOperationAnd, CoreOperationCompare, CoreOperationDivide, CoreOperationGreaterThan, CoreOperationGreaterThanOrEqual, CoreOperationLessThan, CoreOperationLessThanOrEqual, CoreOperationMod, CoreOperationMultiply, CoreOperationNegate, CoreOperationOr, CoreOperationSubtract, CoreOperationUnion
- public abstract class CoreOperation
- extends Operation
The common subclass for tree elements representing core operations like "+",
"- ", "*" etc.
- Version:
- $Revision: 1.12 $ $Date: 2003/03/11 00:59:22 $
- Author:
- Dmitri Plotnikov
Fields inherited from class org.apache.commons.jxpath.ri.compiler.Operation |
args |
Method Summary |
java.lang.Object |
compute(EvalContext context)
|
abstract java.lang.Object |
computeValue(EvalContext context)
Evaluates the expression. |
protected abstract int |
getPrecedence()
Computes the precedence of the operation. |
abstract java.lang.String |
getSymbol()
Returns the XPath symbol for this operation, e.g. |
protected abstract boolean |
isSymmetric()
Returns true if the operation is not sensitive to the order of arguments,
e.g. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
CoreOperation
public CoreOperation(Expression[] args)
compute
public java.lang.Object compute(EvalContext context)
- Overrides:
compute
in class Expression
computeValue
public abstract java.lang.Object computeValue(EvalContext context)
- Description copied from class:
Expression
- Evaluates the expression. If the result is a node set, returns
the first element of the node set.
- Overrides:
computeValue
in class Expression
getSymbol
public abstract java.lang.String getSymbol()
- Returns the XPath symbol for this operation, e.g. "+", "div", etc.
isSymmetric
protected abstract boolean isSymmetric()
- Returns true if the operation is not sensitive to the order of arguments,
e.g. "=", "and" etc, and false if it is, e.g. "<=", "div".
getPrecedence
protected abstract int getPrecedence()
- Computes the precedence of the operation.
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
Copyright © 2001-2003 Apache Software Foundation. All Rights Reserved.