Class CoreOperationCompare
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.CoreOperationCompare
- Direct Known Subclasses:
CoreOperationEqual, CoreOperationNotEqual
Common superclass for the implementations of Expression for the operations
"=" and "!=".
- Version:
- $Revision: 652845 $ $Date: 2008-05-02 12:46:46 -0500 (Fri, 02 May 2008) $
- Author:
- Dmitri Plotnikov
-
Nested Class Summary
Nested classes/interfaces inherited from class Expression
Expression.PointerIterator, Expression.ValueIterator -
Field Summary
FieldsFields inherited from class CoreOperation
ADD_PRECEDENCE, AND_PRECEDENCE, COMPARE_PRECEDENCE, MULTIPLY_PRECEDENCE, NEGATE_PRECEDENCE, OR_PRECEDENCE, RELATIONAL_EXPR_PRECEDENCE, UNION_PRECEDENCEFields inherited from class Expression
NOT_A_NUMBER, ONE, ZERO -
Constructor Summary
ConstructorsModifierConstructorDescriptionCoreOperationCompare(Expression arg1, Expression arg2) Create a new CoreOperationCompare.protectedCoreOperationCompare(Expression arg1, Expression arg2, boolean invert) Create a new CoreOperationCompare. -
Method Summary
Modifier and TypeMethodDescriptioncomputeValue(EvalContext context) Evaluates the expression.protected booleanLearn whether it contains value.protected booleanLearn whether l equals r in XPath terms.protected booleanequal(EvalContext context, Expression left, Expression right) Compares two values.protected booleanLearn whether lit intersects rit.protected intComputes the precedence of the operation.protected booleanReturns true if the operation is not sensitive to the order of arguments, e.g.Methods inherited from class CoreOperation
compute, getSymbol, toStringMethods inherited from class Operation
computeContextDependent, getArgumentsMethods inherited from class Expression
isContextDependent, iterate, iteratePointers
-
Field Details
-
invert
private boolean invert
-
-
Constructor Details
-
CoreOperationCompare
Create a new CoreOperationCompare.- Parameters:
arg1- left operandarg2- right operand
-
CoreOperationCompare
Create a new CoreOperationCompare.- Parameters:
arg1- left operandarg2- right operandinvert- whether to invert (not) the comparison
-
-
Method Details
-
computeValue
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 int getPrecedence()Description copied from class:CoreOperationComputes the precedence of the operation.- Specified by:
getPrecedencein classCoreOperation- Returns:
- int precedence
-
isSymmetric
protected 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
-
equal
Compares two values.- Parameters:
context- evaluation contextleft- operandright- operand- Returns:
- whether left = right in XPath terms
-
contains
-
findMatch
-
equal
-