|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--opale.mathtools.ScanString
This class is similar to the ScanWord class, except it scans a string for keywords rather than an input stream.
Field Summary | |
static int |
EOS
flag the End of String |
static int |
ERROR
Flag an error |
static int |
NUMBER
Flag a Number |
double |
nval
|
java.lang.String |
sval
|
static int |
UNKNOWN
flag an unknown token |
Constructor Summary | |
ScanString()
Instantiate the Class |
|
ScanString(java.lang.String s)
Instantaite the Class |
Method Summary | |
void |
addKeyWord(java.lang.String s,
int i)
Add a keyword/token pair to the table of keywords to scan for. |
int |
getKeyValue(java.lang.String s)
|
int |
nextWord()
Process the string and return the next token found. |
void |
resetKeyWords()
Clear the table containing the keyword/token pairs |
void |
setString(java.lang.String s)
Set the string to be scanned |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int UNKNOWN
public static final int ERROR
public static final int NUMBER
public static final int EOS
public java.lang.String sval
public double nval
Constructor Detail |
public ScanString()
public ScanString(java.lang.String s)
s
- String to scan for tokensMethod Detail |
public void setString(java.lang.String s)
s
- Stringpublic void addKeyWord(java.lang.String s, int i)
s
- keyword string to scan fori
- token to return when the keyword is foundpublic int getKeyValue(java.lang.String s)
s
- keyword stringpublic void resetKeyWords()
public int nextWord()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |