|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.isti.util.CfgFileTokenizer
public class CfgFileTokenizer
Class CfgFileTokenizer extends StreamTokenizer and sets up for configuration file parsing.
Field Summary | |
---|---|
static int |
TT_EOF
A constant indicating that the end of the stream has been read. |
static int |
TT_EOL
A constant indicating that the end of the line has been read. |
static int |
TT_NUMBER
A constant indicating that a number token has been read. |
static int |
TT_WORD
A constant indicating that a word token has been read. |
Constructor Summary | |
---|---|
CfgFileTokenizer(java.io.Reader rdr)
Creates an object which reads from the given input stream. |
|
CfgFileTokenizer(java.io.Reader rdr,
boolean wordSlashFlag)
Creates an object which reads from the given input stream. |
|
CfgFileTokenizer(java.io.Reader rdr,
boolean wordSlashFlag,
boolean commaSepFlag)
Creates an object which reads from the given input stream. |
Method Summary | |
---|---|
void |
dumpTokens(java.io.PrintStream out)
Sends display of tokens to the given print stream. |
java.lang.String |
getNonNullTokenString()
Returns the token string fetched by 'nextToken()'. |
java.lang.Number |
getNumberToken()
Returns the token fetched by 'nextToken()' as a numeric object. |
java.lang.String |
getTokenString()
Returns the token string fetched by 'nextToken()'. |
int |
lineno()
Returns the current line number. |
int |
nextToken()
Parses the next token from the input stream. |
int |
nextToken(boolean eolFlag)
Parses the next token from the input stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int TT_EOF
public static final int TT_EOL
public static final int TT_NUMBER
public static final int TT_WORD
Constructor Detail |
---|
public CfgFileTokenizer(java.io.Reader rdr, boolean wordSlashFlag, boolean commaSepFlag)
rdr
- the input stream to read from.wordSlashFlag
- true to allow the forward-slash character to be
parsed as part of a word token (this disables '//' comments); false
to make the forward-slash character be a token separator.commaSepFlag
- true for comma to be a token separator; false
for comma to be parsed as part of a word token.public CfgFileTokenizer(java.io.Reader rdr, boolean wordSlashFlag)
rdr
- the input stream to read from.wordSlashFlag
- true to allow the forward-slash character to be
parsed as part of a word token (this disables '//' comments); false
to make the forward-slash character be a token separator.public CfgFileTokenizer(java.io.Reader rdr)
rdr
- the input stream to read from.Method Detail |
---|
public int nextToken(boolean eolFlag) throws java.io.IOException
eolFlag
- if true then all tokens and words until the next
end-of-line are read in and returned as a single token string.
java.io.IOException
- if an I/O error occurs.public int nextToken() throws java.io.IOException
java.io.IOException
- if an I/O error occurs.public java.lang.String getTokenString()
public java.lang.String getNonNullTokenString()
public java.lang.Number getNumberToken()
public int lineno()
public void dumpTokens(java.io.PrintStream out) throws java.io.IOException
out
- output stream
java.io.IOException
- if an I/O error occurs.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |