public class NumberCompareExpression extends CompareExpression
Compares Numbers(including AtomicLong, AtomicInteger, Long, Integer, Double, etc) Typical usage is to use AtomicLong or AtomicInteger as one operand and use Long or Integer as another.
leftOperand, operation, rightOperandchildren, FALSE, OPERAND, OPERATOR_AND, OPERATOR_NOT, OPERATOR_OR, operatorType, TRUE| Constructor and Description |
|---|
NumberCompareExpression(Number leftOperand,
int operation,
Number rightOperand)
直接把待比较的数字带进去。真正的比较会发生在evaluate的时候。
调用evaluate()方法的时候传递的context参数不会被用到。
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
compare(Object context)
子类应该实现这个方法,利用leftOperand, operation, rightOperand、以及context来
作具体的比较运算,返回确切的结果。
|
addOperand, addOperand, evaluate, toStringaddOperand, AND, AND, evaluate, HAS, NOT, OR, ORprotected boolean compare(Object context)
CompareExpressioncompare in class CompareExpressioncontext - this argument is useless, you can pass null directlyCompareExpression.compare(java.lang.Object)Copyright © 2014. All Rights Reserved.