| Modifier and Type | Class and Description |
|---|---|
static class |
Operator.Associativity
An Operator's associativity.
|
| Constructor and Description |
|---|
Operator(String symbol,
int operandCount,
Operator.Associativity associativity,
int precedence)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
Operator.Associativity |
getAssociativity()
Gets this operator's associativity.
|
int |
getOperandCount()
Gets the operator's operand count.
|
int |
getPrecedence()
Gets the operator's precedence.
|
String |
getSymbol()
Gets the operator's symbol.
|
int |
hashCode() |
public Operator(String symbol, int operandCount, Operator.Associativity associativity, int precedence)
symbol - The operator name (Currently, the name's length must be one character).operandCount - The number of operands of the operator (must be 1 or 2).associativity - The associativity of the operator.precedence - The precedence of the operator.
IllegalArgumentException - if operandCount if not 1 or 2, or if associativity is Operator.Associativity.NONE or null, or if symbol is null, empty
or starts/ends with a space character.public String getSymbol()
public int getOperandCount()
public Operator.Associativity getAssociativity()
public int getPrecedence()
3.0.5