com.bpodgursky.jbool_expressions.Not Maven / Gradle / Ivy
package com.bpodgursky.jbool_expressions;
import com.bpodgursky.jbool_expressions.rules.Rule;
import com.bpodgursky.jbool_expressions.rules.RuleSet;
import java.util.List;
public class Not extends Expression {
public static final String EXPR_TYPE = "not";
private final Expression e;
private Not(Expression e){
this.e = e;
}
public Expression getE(){
return e;
}
public String toString(){
return "!"+e;
}
@Override
public Expression apply(List> rules) {
return new Not(RuleSet.applyAll(e, rules));
}
@Override
public boolean equals(Expression expr) {
return expr instanceof Not && ((Not)expr).getE().equals(getE());
}
public static Not of(Expression e){
return new Not(e);
}
@Override
public String getExprType() {
return EXPR_TYPE;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy