|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--arlut.csd.Util.Parser
This class provides some extra utility methods to apply to a
StreamTokenizer to make parsing the GASH files easier.
The Parser code assumes that the tokenizer has been set up to
treat ':', ',', and '\n' as distinct tokens, with everything else
treated as word chars.
| Field Summary | |
(package private) java.io.StreamTokenizer |
tokens
|
| Constructor Summary | |
Parser(java.io.StreamTokenizer tokens)
|
|
| Method Summary | |
boolean |
atEOF()
Returns true if we're at EOF |
boolean |
atEOL()
Returns true if we're at EOL |
int |
checkNextToken()
This method returns a peek at the next token in the StreamTokenizer that this Parser was initialized with. |
int |
checkNextToken(java.io.StreamTokenizer tokens)
This method returns a peek at the next token in the StreamTokenizer passed in. |
boolean |
EOFnext()
Returns true if the next thing to be read is EOF |
boolean |
EOLnext()
Returns true if the next thing to be read is EOL |
java.lang.String |
getNextBit()
getNextBit() returns the next String from the StreamTokenizer that this Parser was initialized with, skipping a single leading ':'s and ','s along the way, up to the next ',' or ':'. |
java.lang.String |
getNextBit(boolean skipleading)
getNextBit() returns the next String from the StreamTokenizer that this Parser was initialized with. |
java.lang.String |
getNextBit(java.io.StreamTokenizer tokens)
getNextBit() returns the next String from the StreamTokenizer, where the bits are separated by colons and commas. |
java.lang.String |
getNextBit(java.io.StreamTokenizer tokens,
boolean skipleading,
boolean includeCommas)
getNextBit() returns the next String from the StreamTokenizer, where the bits are separated by colons and commas. |
int |
getNextInt()
getNextBit() returns the next String from the StreamTokenizer that this Parser was initialized with. |
java.lang.String |
getNextLongBit()
getNextLongBit() returns the next String from the StreamTokenizer that this Parser was initialized with, skipping a single leading ':'s along the way, up to the next ':'. |
void |
setStream(java.io.StreamTokenizer tokens)
This method connects this Parser object to a different StreamTokenizer. |
void |
skipToEndLine()
This method runs tokens to the end of the line. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
java.io.StreamTokenizer tokens
| Constructor Detail |
public Parser(java.io.StreamTokenizer tokens)
| Method Detail |
public void setStream(java.io.StreamTokenizer tokens)
public boolean atEOL()
public boolean atEOF()
public boolean EOLnext()
throws java.io.IOException
java.io.IOException
public boolean EOFnext()
throws java.io.IOException
java.io.IOException
public void skipToEndLine()
throws java.io.IOException
java.io.IOException
public int getNextInt()
throws java.io.IOException,
java.lang.NumberFormatException
java.io.IOException
java.lang.NumberFormatException
public java.lang.String getNextBit()
throws java.io.IOException
java.io.IOException
public java.lang.String getNextLongBit()
throws java.io.IOException
java.io.IOException
public java.lang.String getNextBit(boolean skipleading)
throws java.io.IOException
skipleading - if true, getNextBit will chew through leading
commas and colons until it gets to either a normal string or
eol/eof.
java.io.IOException
public java.lang.String getNextBit(java.io.StreamTokenizer tokens)
throws java.io.IOException
tokens - The StreamTokenizer to read from
java.io.IOException
public java.lang.String getNextBit(java.io.StreamTokenizer tokens,
boolean skipleading,
boolean includeCommas)
throws java.io.IOException
skipleading - if true, getNextBit will chew through leading
commas and colons until it gets to either a normal string or
eol/eof.includeCommas - if true, getNextBit will not treat commas as
field separators
java.io.IOException
public int checkNextToken()
throws java.io.IOException
java.io.IOException
public int checkNextToken(java.io.StreamTokenizer tokens)
throws java.io.IOException
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||