if (exp instanceof ConstInteger) {
((ConstInteger) exp).inverse();
} else if (exp instanceof ConstDouble) {
((ConstDouble) exp).inverse();
} else {
expressions[index] = mode == INTEGER ? new SubInteger(new ConstInteger(
0), exp) : new SubDouble(new ConstDouble(0.0), exp);
}
break;
case NOT:
expressions[index] = new NotCheck(exp);
break;
case MUL:
expressions[index] = mode == INTEGER ? new MulInteger(exp,
expressions[index + 1]) : new MulDouble(exp, expressions[index + 1]);
break;
case DIV:
expressions[index] = mode == INTEGER ? new DivInteger(exp,
expressions[index + 1]) : new DivDouble(exp, expressions[index + 1]);
break;
case MOD:
expressions[index] = mode == INTEGER ? new ModInteger(exp,
expressions[index + 1]) : new ModDouble(exp, expressions[index + 1]);
break;
case ADD:
expressions[index] = mode == INTEGER ? new AddInteger(exp,
expressions[index + 1]) : new AddDouble(exp, expressions[index + 1]);
break;
case SUB:
expressions[index] = mode == INTEGER ? new SubInteger(exp,
expressions[index + 1]) : new SubDouble(exp, expressions[index + 1]);
break;
case GT:
expressions[index] = new GTCheck(exp, expressions[index + 1]);
break;
case LT:
expressions[index] = new LTCheck(exp, expressions[index + 1]);
break;
case EQ:
expressions[index] = new EQCheck(exp, expressions[index + 1]);
break;
case NEQ:
expressions[index] = new NECheck(exp, expressions[index + 1]);
break;
case AEQ:
expressions[index] = new AEQCheck(exp, expressions[index + 1]);
break;
case ANE:
expressions[index] = new ANEQCheck(exp, expressions[index + 1]);
break;
case GTE:
expressions[index] = new GECheck(exp, expressions[index + 1]);
break;
case LTE:
expressions[index] = new LECheck(exp, expressions[index + 1]);
break;
case AND:
expressions[index] = mode == OBJECT ? new ObjectAndExpression(exp,
expressions[index + 1]) : new AndCheck(exp, expressions[index + 1]);
break;
case OR:
expressions[index] = mode == OBJECT ? new ObjectOrExpression(exp,
expressions[index + 1]) : new OrCheck(exp, expressions[index + 1]);
break;
case ISDIVBY:
expressions[index] = new NotCheck(new ModInteger(exp,
expressions[index + 1]));
break;
case ISEVENBY:
expressions[index] = new NotCheck(new ModInteger(new DivInteger(exp,
expressions[index + 1]), new ConstInteger(2)));
break;
case ISODDBY:
expressions[index] = new ModInteger(new DivInteger(exp,
expressions[index + 1]), new ConstInteger(2));
break;
case ISEVEN:
expressions[index] = new NotCheck(
new ModInteger(exp, new ConstInteger(2)));
break;
case ISODD:
expressions[index] = new ModInteger(exp, new ConstInteger(2));
break;
}
return param - 1;
}