public enum IntegerUnaryOperation extends Enum<IntegerUnaryOperation> implements Operation
Enum Constant and Description |
---|
MINUS
Decimal unary minus.
|
PLUS
Decimal unary plus.
|
Modifier and Type | Method and Description |
---|---|
protected abstract Decimal |
exec(Decimal arg)
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 arg) |
static IntegerUnaryOperation |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static IntegerUnaryOperation[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final IntegerUnaryOperation PLUS
public static final IntegerUnaryOperation MINUS
public static IntegerUnaryOperation[] values()
for (IntegerUnaryOperation c : IntegerUnaryOperation.values()) System.out.println(c);
public static IntegerUnaryOperation 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 arg) throws ErrorException
ErrorException
Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.