default: throw new Error("unknown predicate " + this);
}
}
+
+ /** evaluates this predicate for a given set of flags and olc */
+ public boolean evaluate(boolean flag_a, boolean flag_b, boolean flag_c, boolean olc_zero) {
+ switch(this) {
+ case Default: return !olc_zero;
+ case FlagA: return !olc_zero && flag_a;
+ case FlagB: return !olc_zero && flag_b;
+ case FlagC: return !olc_zero && flag_c;
+ case NotFlagA: return !olc_zero && !flag_a;
+ case NotFlagB: return !olc_zero && !flag_b;
+ case NotFlagC: return !olc_zero && !flag_c;
+ case IgnoreOLC: return true;
+ case OLCZero: return olc_zero;
+ default: throw new Error("unknown predicate " + this);
+ }
+ }
+
}