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
public abstract class CoreOperationRelationalExpression extends CoreOperation
Base implementation of Expression for the operations ">", ">=", "<", "<=".- Since:
- JXPath 1.3
- Version:
- $Revision: 652845 $ $Date: 2008-05-02 12:46:46 -0500 (Fri, 02 May 2008) $
- Author:
- Matt Benson
-
-
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
Constructors Modifier Constructor Description protectedCoreOperationRelationalExpression(Expression[] args)Create a new CoreOperationRelationalExpression.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectcomputeValue(EvalContext context)Evaluates the expression.protected abstract booleanevaluateCompare(int compare)Template method for subclasses to evaluate the result of a comparison.protected intgetPrecedence()Computes the precedence of the operation.protected booleanisSymmetric()Returns true if the operation is not sensitive to the order of arguments, e.g.-
Methods 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 Detail
-
CoreOperationRelationalExpression
protected CoreOperationRelationalExpression(Expression[] args)
Create a new CoreOperationRelationalExpression.- Parameters:
args- arguments
-
-
Method Detail
-
computeValue
public final java.lang.Object computeValue(EvalContext context)
Description copied from class:ExpressionEvaluates the expression. If the result is a node set, returns the first element of the node set.- Specified by:
computeValuein classCoreOperation- Parameters:
context- evaluation context- Returns:
- Object
-
getPrecedence
protected final int getPrecedence()
Description copied from class:CoreOperationComputes the precedence of the operation.- Specified by:
getPrecedencein classCoreOperation- Returns:
- int precedence
-
isSymmetric
protected final boolean isSymmetric()
Description copied from class:CoreOperationReturns 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:
isSymmetricin classCoreOperation- Returns:
- boolean
-
evaluateCompare
protected abstract boolean evaluateCompare(int compare)
Template method for subclasses to evaluate the result of a comparison.- Parameters:
compare- result of comparison to evaluate- Returns:
- ultimate operation success/failure
-
-