public enum DecimalBinaryArithmeticOperation extends Enum<DecimalBinaryArithmeticOperation> implements Operation
Enum Constant and Description |
---|
DEC_POW
Decimal power.
|
DIVIDE
Decimal divide.
|
INT_POW
Integer power.
|
MINUS
Decimal minus.
|
MODULO
Decimal modulo.
|
PLUS
Decimal plus.
|
TIMES
Decimal times.
|
Modifier and Type | Method and Description |
---|---|
protected abstract Decimal |
exec(Decimal left,
Decimal right,
InterpreterStackTrace stackTrace)
Executes the operation with the operands interpreted.
|
Decimal |
execute(Interpreter interpreter,
List<Expression> args,
boolean variadicArgAsList,
InterpreterStackTrace stackTrace)
Executes the expression.
|
Decimal |
execute(Namespace namespace,
String operation,
Decimal left,
Decimal right) |
static DecimalBinaryArithmeticOperation |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static DecimalBinaryArithmeticOperation[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final DecimalBinaryArithmeticOperation PLUS
public static final DecimalBinaryArithmeticOperation MINUS
public static final DecimalBinaryArithmeticOperation TIMES
public static final DecimalBinaryArithmeticOperation DIVIDE
public static final DecimalBinaryArithmeticOperation MODULO
public static final DecimalBinaryArithmeticOperation INT_POW
public static final DecimalBinaryArithmeticOperation DEC_POW
public static DecimalBinaryArithmeticOperation[] values()
for (DecimalBinaryArithmeticOperation c : DecimalBinaryArithmeticOperation.values()) System.out.println(c);
public static DecimalBinaryArithmeticOperation valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic Decimal execute(Interpreter interpreter, List<Expression> args, boolean variadicArgAsList, InterpreterStackTrace stackTrace) throws ErrorException
Operation
execute
in interface Operation
variadicArgAsList
- if true
, the variadic argument is given as expression
returning a list; if false
, the variadic argument
is given as several individual expressionsstackTrace
- a stack trace passed to the interpreterErrorException
public Decimal execute(Namespace namespace, String operation, Decimal left, Decimal right) throws ErrorException
ErrorException
protected abstract Decimal exec(Decimal left, Decimal right, InterpreterStackTrace stackTrace) throws ErrorException
left
- right
- stackTrace
- ErrorException
Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.