org.nutz.el.opt.logic.GTEOpt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nutz Show documentation
Show all versions of nutz Show documentation
Nutz, which is a collections of lightweight frameworks, each of them can be used independently
package org.nutz.el.opt.logic;
import org.nutz.el.opt.TwoTernary;
/**
* 大于等于
* @author juqkai([email protected])
*
*/
public class GTEOpt extends TwoTernary {
public int fetchPriority() {
return 6;
}
public Object calculate() {
Number lval = (Number) calculateItem(this.left);
Number rval = (Number) calculateItem(this.right);
if(rval instanceof Double || lval instanceof Double){
return lval.doubleValue() >= rval.doubleValue();
}
if(rval instanceof Float || lval instanceof Float){
return lval.floatValue() >= rval.floatValue();
}
if(rval instanceof Long || lval instanceof Long){
return lval.longValue() >= rval.longValue();
}
return lval.intValue() >= rval.intValue();
}
public String fetchSelf() {
return ">=";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy