01: package org.hansel.stack;
02:
03: public class AndAndOp extends BinaryOperatorEntry {
04:
05: public AndAndOp(HanselValue op1, HanselValue op2) {
06: super ("&&", 10, op1, op2);
07: }
08:
09: public HanselValue compress() {
10: HanselValue op1 = getOperator1().compress();
11: HanselValue op2 = getOperator2().compress();
12:
13: if ((op1 instanceof NotOp) && (op2 instanceof NotOp)) {
14: return new NotOp(new OrOrOp(op1.invert(), op2.invert()));
15: }
16:
17: return new AndAndOp(op1, op2);
18: }
19:
20: }
|