public class Operator extends Object
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
- true if operator is left associativeprecedence
- The precedence of the operator.
IllegalArgumentException
- if operandCount if not 1 or 2 or if associativity is noneNullPointerException
- if symbol or associativity are nullpublic String getSymbol()
public int getOperandCount()
public Operator.Associativity getAssociativity()
public int getPrecedence()
Copyright © 2014. All Rights Reserved.