public abstract class CoreOperationRelationalExpression extends CoreOperation
Expression.PointerIterator, Expression.ValueIterator
ADD_PRECEDENCE, AND_PRECEDENCE, COMPARE_PRECEDENCE, MULTIPLY_PRECEDENCE, NEGATE_PRECEDENCE, OR_PRECEDENCE, RELATIONAL_EXPR_PRECEDENCE, UNION_PRECEDENCE
NOT_A_NUMBER, ONE, ZERO
Modifier | Constructor and Description |
---|---|
protected |
CoreOperationRelationalExpression(Expression[] args)
Create a new CoreOperationRelationalExpression.
|
Modifier and Type | Method and Description |
---|---|
private boolean |
compute(java.lang.Object left,
java.lang.Object right)
Compare left to right.
|
java.lang.Object |
computeValue(EvalContext context)
Evaluates the expression.
|
private boolean |
containsMatch(java.util.Iterator it,
java.lang.Object value)
Learn whether any element returned from an Iterator matches a given value.
|
protected abstract boolean |
evaluateCompare(int compare)
Template method for subclasses to evaluate the result of a comparison.
|
private boolean |
findMatch(java.util.Iterator lit,
java.util.Iterator rit)
Learn whether there is an intersection between two Iterators.
|
protected int |
getPrecedence()
Computes the precedence of the operation.
|
protected boolean |
isSymmetric()
Returns true if the operation is not sensitive to the order of arguments,
e.g.
|
private java.lang.Object |
reduce(java.lang.Object o)
Reduce an operand for comparison.
|
compute, getSymbol, toString
computeContextDependent, getArguments
isContextDependent, iterate, iteratePointers
protected CoreOperationRelationalExpression(Expression[] args)
args
- argumentspublic final java.lang.Object computeValue(EvalContext context)
Expression
computeValue
in class CoreOperation
context
- evaluation contextprotected final int getPrecedence()
CoreOperation
getPrecedence
in class CoreOperation
protected final boolean isSymmetric()
CoreOperation
isSymmetric
in class CoreOperation
protected abstract boolean evaluateCompare(int compare)
compare
- result of comparison to evaluateprivate boolean compute(java.lang.Object left, java.lang.Object right)
left
- left operandright
- right operandprivate java.lang.Object reduce(java.lang.Object o)
o
- Object to reduceprivate boolean containsMatch(java.util.Iterator it, java.lang.Object value)
it
- Iteratorvalue
- to look forprivate boolean findMatch(java.util.Iterator lit, java.util.Iterator rit)
lit
- left Iteratorrit
- right Iterator