|
trassare.com | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.trassare.calculator.engine.Token
public class Token
A Token class for use in a scanner for simple arithmetic expressions.
CS 152, Fall, 2005
Programming Assignment #1
| Nested Class Summary | |
|---|---|
static class |
Token.ERROR
Token matching an erroneous character in input. CS 152, Fall, 2005 Programming Assignment #1 |
static class |
Token.IDENTIFIER
Token matching regular expression [A-Z]+ in input. This token is used for variable names in the input expression. |
static class |
Token.NUMBER
Token matching regular expression [0-9]+(\.[0-9]*)? in input. CS 152, Fall, 2005 Programming Assignment #1 |
| Field Summary | |
|---|---|
static Token |
ACOS
Token matching 'acos' in input. |
static Token |
ASIN
Token matching 'asin' in input. |
static Token |
ASSIGN
Token matching '>>' in input. |
static Token |
ATAN
Token matching 'atan' in input. |
static Token |
COS
Token matching 'cos' in input. |
static Token |
EOL
Token matching end of line. |
static Token |
ERROR
A dummy ERROR token for equality testing. |
static Token |
IDENTIFIER
A dummy IDENTIFIER token for equality testing. |
static Token |
LN
Token matching 'ln' in input. |
static Token |
LPAREN
Token matching '(' in input. |
static Token |
MINUS
Token matching '-' in input. |
static Token |
NUMBER
A dummy NUMBER token for equality testing. |
static Token |
OVER
Token matching '/' in input. |
static Token |
PLUS
Token matching '+' in input. |
static Token |
POW
Token matching '^' in input. |
static Token |
RECALL
Deprecated. Do not use this token. It will be removed in future versions of this class. |
static Token |
RPAREN
Token matching ')' in input. |
static Token |
SIN
Token matching 'sin' in input. |
static Token |
STORE
Deprecated. Do not use this token. It will be removed in future versions of this class. Instead use Token.ASSIGN. This
token was originally used as a command to send the evaluated
expression to a single memory cell. The use of
Token.ASSIGN signals an assignment to a
variable. Beginning with the 10 September 2006 version of this
class the com.trassare.calculator.engine package now supports
infinite memory storage. |
static Token |
TAN
Token matching 'tan' in input. |
static Token |
TIMES
Token matching '*' in input. |
| Constructor Summary | |
|---|---|
protected |
Token(String inValue)
Make the constructor protected so that only limited kinds of tokens can be generated. |
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
Overrides Object.equals: all tokens in the same token subclass are implicitly equal. |
int |
hashCode()
Dummy hash code implementation. |
String |
stringValue()
An accessor method for the stringValue field. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Token ACOS
public static final Token ASIN
public static final Token ASSIGN
2+2>>VAR
public static final Token ATAN
public static final Token COS
public static final Token EOL
public static final Token ERROR
public static final Token LN
public static final Token LPAREN
public static final Token MINUS
public static final Token NUMBER
public static final Token IDENTIFIER
public static final Token OVER
public static final Token PLUS
public static final Token POW
public static final Token RECALL
public static final Token RPAREN
public static final Token SIN
public static final Token STORE
Token.ASSIGN. This
token was originally used as a command to send the evaluated
expression to a single memory cell. The use of
Token.ASSIGN signals an assignment to a
variable. Beginning with the 10 September 2006 version of this
class the com.trassare.calculator.engine package now supports
infinite memory storage.
public static final Token TAN
public static final Token TIMES
| Constructor Detail |
|---|
protected Token(String inValue)
inValue - the string value of the token| Method Detail |
|---|
public final boolean equals(Object obj)
equals in class Objectobj - the object against which this object is tested for equality
public final int hashCode()
hashCode in class Objectpublic final String stringValue()
|
trassare.com | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||