public enum ArithmeticOperator extends java.lang.Enum<ArithmeticOperator>
Enum Constant and Description |
---|
ABSOLUTE |
ADD |
DIVIDE |
EQUALS |
GREATER |
GREATER_OR_EQUAL |
LESS |
LESS_OR_EQUAL |
LOGICAL_AND |
LOGICAL_NOT |
LOGICAL_OR |
LOGICAL_XOR |
MODULO |
MULTIPLY |
NEGATE |
NOT_EQUALS |
POWER |
STRICT_EQUALS |
STRICT_NOT_EQUALS |
SUBTRACT |
Modifier and Type | Field and Description |
---|---|
static ArithmeticOperator[] |
VALUES
Array of arithmetic operators to avoid memory allocations.
|
Modifier and Type | Method and Description |
---|---|
Value |
doOperation(Value value)
Performs the action on one value.
|
Value |
doOperation(Value value1,
Value value2)
Performs the action on two values.
|
int |
getPrecedence()
Operator precedence.
|
java.lang.String |
getSymbol()
Operator symbol.
|
boolean |
isBinary()
IS this a binary operator?
|
boolean |
isRightAssociative()
Is this operator right-associative?
|
static ArithmeticOperator |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static ArithmeticOperator[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ArithmeticOperator ABSOLUTE
public static final ArithmeticOperator ADD
public static final ArithmeticOperator DIVIDE
public static final ArithmeticOperator EQUALS
public static final ArithmeticOperator GREATER
public static final ArithmeticOperator GREATER_OR_EQUAL
public static final ArithmeticOperator LESS
public static final ArithmeticOperator LESS_OR_EQUAL
public static final ArithmeticOperator LOGICAL_AND
public static final ArithmeticOperator LOGICAL_NOT
public static final ArithmeticOperator LOGICAL_OR
public static final ArithmeticOperator LOGICAL_XOR
public static final ArithmeticOperator MODULO
public static final ArithmeticOperator MULTIPLY
public static final ArithmeticOperator NEGATE
public static final ArithmeticOperator NOT_EQUALS
public static final ArithmeticOperator POWER
public static final ArithmeticOperator STRICT_EQUALS
public static final ArithmeticOperator STRICT_NOT_EQUALS
public static final ArithmeticOperator SUBTRACT
public static final ArithmeticOperator[] VALUES
public static ArithmeticOperator[] values()
for (ArithmeticOperator c : ArithmeticOperator.values()) System.out.println(c);
public static ArithmeticOperator valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic java.lang.String getSymbol()
public int getPrecedence()
public boolean isBinary()
public boolean isRightAssociative()
public Value doOperation(Value value)
value
- the valuejava.lang.ArithmeticException
- If an arithmetic exception occurs.