Class CoreOperationRelationalExpression
java.lang.Object
org.apache.commons.jxpath.ri.compiler.Expression
org.apache.commons.jxpath.ri.compiler.Operation
org.apache.commons.jxpath.ri.compiler.CoreOperation
org.apache.commons.jxpath.ri.compiler.CoreOperationRelationalExpression
- Direct Known Subclasses:
CoreOperationGreaterThan
,CoreOperationGreaterThanOrEqual
,CoreOperationLessThan
,CoreOperationLessThanOrEqual
Base implementation of Expression for the operations ">", ">=", "<", "<=".
- Since:
- JXPath 1.3
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.commons.jxpath.ri.compiler.Expression
Expression.PointerIterator, Expression.ValueIterator
-
Field Summary
Fields inherited from class org.apache.commons.jxpath.ri.compiler.CoreOperation
ADD_PRECEDENCE, AND_PRECEDENCE, COMPARE_PRECEDENCE, MULTIPLY_PRECEDENCE, NEGATE_PRECEDENCE, OR_PRECEDENCE, RELATIONAL_EXPR_PRECEDENCE, UNION_PRECEDENCE
Fields inherited from class org.apache.commons.jxpath.ri.compiler.Expression
NOT_A_NUMBER, ONE, ZERO
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Constructs a new CoreOperationRelationalExpression. -
Method Summary
Modifier and TypeMethodDescriptionfinal Object
computeValue
(EvalContext context) Evaluates the expression.protected abstract boolean
evaluateCompare
(int compare) Template method for subclasses to evaluate the result of a comparison.protected final int
Computes the precedence of the operation.protected final boolean
Returns true if the operation is not sensitive to the order of arguments, e.g. "=", "and" etc, and false if it is, e.gMethods inherited from class org.apache.commons.jxpath.ri.compiler.CoreOperation
compute, getSymbol, toString
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
-
Constructor Details
-
Method Details
-
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 classCoreOperation
- Parameters:
context
- evaluation context- Returns:
- Object
-
evaluateCompare
Template method for subclasses to evaluate the result of a comparison.- Parameters:
compare
- result of comparison to evaluate- Returns:
- ultimate operation success/failure
-
getPrecedence
Description copied from class:CoreOperation
Computes the precedence of the operation.- Specified by:
getPrecedence
in classCoreOperation
- Returns:
- int precedence
-
isSymmetric
Description copied from class:CoreOperation
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".- Specified by:
isSymmetric
in classCoreOperation
- Returns:
- boolean
-