public class Operator
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Operator.Associativity
An Operator's associativity.
|
Constructor and Description |
---|
Operator(java.lang.String symbol,
int operandCount,
Operator.Associativity associativity,
int precedence)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.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.
|
java.lang.String |
getSymbol()
Gets the operator's symbol.
|
int |
hashCode() |
public Operator(java.lang.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
- true if operator is left associativeprecedence
- The precedence of the operator.
public java.lang.String getSymbol()
public int getOperandCount()
public Operator.Associativity getAssociativity()
public int getPrecedence()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object