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
,CoreOperationMod
,CoreOperationMultiply
,CoreOperationNegate
,CoreOperationOr
,CoreOperationRelationalExpression
,CoreOperationSubtract
,CoreOperationUnion
The common subclass for tree elements representing core operations like "+", "- ", "*" etc.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.commons.jxpath.ri.compiler.Expression
Expression.PointerIterator, Expression.ValueIterator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final int
Add/subtract precedenceprotected static final int
And precedenceprotected static final int
Compare precedenceprotected static final int
Multiply/divide/mod precedenceprotected static final int
Negate precedenceprotected static final int
Or precedenceprotected static final int
Relational expression precedenceprotected static final int
Union precedenceFields inherited from class org.apache.commons.jxpath.ri.compiler.Expression
NOT_A_NUMBER, ONE, ZERO
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncompute
(EvalContext context) Evaluates the expression.abstract Object
computeValue
(EvalContext context) Evaluates the expression.protected abstract int
Computes the precedence of the operation.abstract String
Returns the XPath symbol for this operation, e.g. "+", "div", etc.protected abstract boolean
Returns true if the operation is not sensitive to the order of arguments, e.g. "=", "and" etc, and false if it is, e.gtoString()
Methods inherited from class org.apache.commons.jxpath.ri.compiler.Operation
computeContextDependent, getArguments
Methods inherited from class org.apache.commons.jxpath.ri.compiler.Expression
isContextDependent, iterate, iteratePointers
-
Field Details
-
OR_PRECEDENCE
Or precedence- See Also:
-
AND_PRECEDENCE
And precedence- See Also:
-
COMPARE_PRECEDENCE
Compare precedence- See Also:
-
RELATIONAL_EXPR_PRECEDENCE
Relational expression precedence- See Also:
-
ADD_PRECEDENCE
Add/subtract precedence- See Also:
-
MULTIPLY_PRECEDENCE
Multiply/divide/mod precedence- See Also:
-
NEGATE_PRECEDENCE
Negate precedence- See Also:
-
UNION_PRECEDENCE
Union precedence- See Also:
-
-
Constructor Details
-
Method Details
-
compute
Description copied from class:Expression
Evaluates the expression. If the result is a node set, returns the first element of the node set.- Specified by:
compute
in classExpression
- Parameters:
context
- evaluation context- Returns:
- Object
-
computeValue
Description copied from class:Expression
Evaluates the expression. If the result is a node set, returns the first element of the node set.- Specified by:
computeValue
in classExpression
- Parameters:
context
- evaluation context- Returns:
- Object
-
getPrecedence
Computes the precedence of the operation.- Returns:
- int precedence
-
getSymbol
Returns the XPath symbol for this operation, e.g. "+", "div", etc.- Returns:
- String symbol
-
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".- Returns:
- boolean
-
toString
-