net.sf.jabb.util.exp
Class NumberCompareExpression
java.lang.Object
net.sf.jabb.util.exp.BooleanExpression
net.sf.jabb.util.exp.CompareExpression
net.sf.jabb.util.exp.NumberCompareExpression
- All Implemented Interfaces:
- CompareOperation
public class NumberCompareExpression
- extends CompareExpression
对数字(Number的子类,包括AtomicLong, AtomicInteger, Long, Integer, Double等)进行比较。
比较常见的用法是其中一个操作数用AtomicLong或AtomicInteger,另一个用Long或Integer。
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.
- Author:
- Zhengmao HU (James)
|
Method Summary |
protected boolean |
compare(Object context)
子类应该实现这个方法,利用leftOperand, operation, rightOperand、以及context来
作具体的比较运算,返回确切的结果。 |
NumberCompareExpression
public NumberCompareExpression(Number leftOperand,
int operation,
Number rightOperand)
- 直接把待比较的数字带进去。真正的比较会发生在evaluate的时候。
调用evaluate()方法的时候传递的context参数不会被用到。
- Parameters:
leftOperand - operation - rightOperand -
compare
protected boolean compare(Object context)
- Description copied from class:
CompareExpression
- 子类应该实现这个方法,利用leftOperand, operation, rightOperand、以及context来
作具体的比较运算,返回确切的结果。
- Specified by:
compare in class CompareExpression
- Parameters:
context - this argument is useless, you can pass null directly
- Returns:
- the result
- See Also:
CompareExpression.compare(java.lang.Object)
Copyright © 2012. All Rights Reserved.