/** * Creates a new value update that decrements a value. Note that the data type must be a numeric * type. * * @param decrement the number to decrement by * @return a ValueUpdate specifying the decrement * @throws UnsupportedOperationException if the data type is non-numeric */ public static ValueUpdate createDecrement(Number decrement) { return new ArithmeticValueUpdate(ArithmeticValueUpdate.Operator.SUB, decrement); }
/** * Creates a new value update that divides a value. Note that the data type must be a numeric * type. * * @param divisor the number to divide by * @return a ValueUpdate specifying the division * @throws UnsupportedOperationException if the data type is non-numeric */ public static ValueUpdate createDivide(Number divisor) { return new ArithmeticValueUpdate(ArithmeticValueUpdate.Operator.DIV, divisor); }
/** * Creates a new value update that increments a value. Note that the data type must be a numeric * type. * * @param increment the number to increment by * @return a ValueUpdate specifying the increment * @throws UnsupportedOperationException if the data type is non-numeric */ public static ValueUpdate createIncrement(Number increment) { return new ArithmeticValueUpdate(ArithmeticValueUpdate.Operator.ADD, increment); }
/** * Creates a new value update that multiplies a value. Note that the data type must be a numeric * type. * * @param factor the number to multiply by * @return a ValueUpdate specifying the multiplication * @throws UnsupportedOperationException if the data type is non-numeric */ public static ValueUpdate createMultiply(Number factor) { return new ArithmeticValueUpdate(ArithmeticValueUpdate.Operator.MUL, factor); }
ArithmeticValueUpdate.Operator operator = ArithmeticValueUpdate.Operator.getID(opId); double operand = getDouble(null); return new ArithmeticValueUpdate(operator, operand); case ASSIGN:
ArithmeticValueUpdate.Operator operator = ArithmeticValueUpdate.Operator.getID(opId); double operand = getDouble(null); return new ArithmeticValueUpdate(operator, operand); case ASSIGN: