panda.el.opt.bit.RightShift Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of panda-core Show documentation
Show all versions of panda-core Show documentation
Panda Core is the core module of Panda Framework, it contains commonly used utility classes similar to apache-commons.
package panda.el.opt.bit;
import panda.el.ELContext;
import panda.el.opt.AbstractTwoOpt;
/**
* Right Shift: >>
*/
public class RightShift extends AbstractTwoOpt {
public int getPriority() {
return 5;
}
public Object calculate(ELContext ec) {
Integer lval = (Integer)getLeft(ec);
Integer rval = (Integer)getRight(ec);
if (isReturnNull(ec, lval, rval)) {
return null;
}
return lval >> rval;
}
public String operator() {
return ">>";
}
}