public enum IntegerBinaryArithmeticOperation extends Enum<IntegerBinaryArithmeticOperation> implements Operation
Enum Constant and Description |
---|
DIVIDE
Decimal divide.
|
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 IntegerBinaryArithmeticOperation |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static IntegerBinaryArithmeticOperation[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final IntegerBinaryArithmeticOperation PLUS
public static final IntegerBinaryArithmeticOperation MINUS
public static final IntegerBinaryArithmeticOperation TIMES
public static final IntegerBinaryArithmeticOperation DIVIDE
public static final IntegerBinaryArithmeticOperation MODULO
public static IntegerBinaryArithmeticOperation[] values()
for (IntegerBinaryArithmeticOperation c : IntegerBinaryArithmeticOperation.values()) System.out.println(c);
public static IntegerBinaryArithmeticOperation 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.