public enum ArithmeticOperator extends Enum<ArithmeticOperator>
| Modifier and Type | Class and Description |
|---|---|
static class |
ArithmeticOperator.Arity |
| Modifier and Type | Method and Description |
|---|---|
ArithmeticOperator.Arity |
arity()
Get the 'arity' of the operator.
|
static ArithmeticOperator |
forSymbol(String symbol)
Attempt to find the Operator given a symbol.
|
boolean |
isBinary()
Return whether this is an binary operator.
|
boolean |
isUnary()
Return whether this is an unary operator.
|
boolean |
precedes(ArithmeticOperator operator)
Determine whether this operator has a higher precedence than the supplied operator.
|
String |
symbol()
Get the symbol for this operator
|
String |
toString() |
static ArithmeticOperator |
valueOf(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 ADD
public static final ArithmeticOperator SUBTRACT
public static final ArithmeticOperator MULTIPLY
public static final ArithmeticOperator DIVIDE
public static ArithmeticOperator[] values()
for (ArithmeticOperator c : ArithmeticOperator.values()) System.out.println(c);
public static ArithmeticOperator 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 String symbol()
public ArithmeticOperator.Arity arity()
isUnary(),
isBinary()public boolean isUnary()
arity(),
isBinary()public boolean isBinary()
public boolean precedes(ArithmeticOperator operator)
operator - the other operator; may not be nullpublic String toString()
toString in class Enum<ArithmeticOperator>public static ArithmeticOperator forSymbol(String symbol)
symbol - the symbolIllegalArgumentException - if the symbol is nullCopyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.