*/
public ExprMultiplicativeOper(final ExprMultiplicative operand1,
final ExprUnary operand2, final byte operation)
throws PropertyException {
if (! (operand1.canEvalNumeric())) {
throw new PropertyException(this.getClass().getName()
+ ": Non-numeric operand: " + operand1.toString());
}
this.operand1 = operand1;
if (! (operand2.canEvalNumeric())) {
throw new PropertyException(this.getClass().getName()
+ "Non-numeric operand: " + operand2.toString());
}
this.operand2 = operand2;
/*
* For Modulo Expressions, the unitPower of the two operands must
* be equal. See XSL-FO Specification 1.0, Section 5.9.6.
*/
if (operation == Expr.OPERATION_MOD
&& operand1.getUnitPower()
!= operand2.getUnitPower()) {
throw new PropertyException("Modulo Operator: Unit powers differ: "
+ operand1.toString() + ", " + operand2.toString());
}
if (operation != Expr.OPERATION_MULTIPLY
&& operation != Expr.OPERATION_DIVIDE
&& operation != Expr.OPERATION_MOD) {
throw new PropertyException("MultiplicativeExpr: Illegal Operator: "
+ operation);
}
this.operation = operation;
}