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 "!=".
-
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
ConstructorsModifierConstructorDescriptionCoreOperationCompare
(Expression arg1, Expression arg2) Constructs a new CoreOperationCompare.protected
CoreOperationCompare
(Expression arg1, Expression arg2, boolean invert) Constructs a new CoreOperationCompare. -
Method Summary
Modifier and TypeMethodDescriptioncomputeValue
(EvalContext context) Evaluates the expression.protected boolean
Tests whether it contains value.protected boolean
Tests whether l equals r in XPath terms.protected boolean
equal
(EvalContext context, Expression left, Expression right) Compares two values.protected boolean
Tests whether lit intersects rit.protected int
Computes the precedence of the operation.protected 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
-
contains
Tests whether it contains value.- Parameters:
it
- Iterator to checkvalue
- for which to look- Returns:
- whether value was found
-
equal
Compares two values.- Parameters:
context
- evaluation contextleft
- operandright
- operand- Returns:
- whether left = right in XPath terms
-
equal
Tests whether l equals r in XPath terms.- Parameters:
l
- left operandr
- right operand- Returns:
- whether l = r
-
findMatch
Tests whether lit intersects rit.- Parameters:
lit
- left Iteratorrit
- right Iterator- Returns:
- boolean
-
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
-