panda.el.opt.logic.OrOpt 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.logic;
import panda.el.ELContext;
import panda.el.opt.AbstractTwoOpt;
/**
* or(||)
*/
public class OrOpt extends AbstractTwoOpt {
public int getPriority() {
return 12;
}
public Object calculate(ELContext ec) {
boolean lval = Logics.isTrue(getLeft(ec));
if (lval) {
return true;
}
boolean rval = Logics.isTrue(getRight(ec));
if (rval) {
return true;
}
return false;
}
public String operator() {
return "||";
}
}