|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.cmu.sphinx.util.ExtendedStreamTokenizer
A class that provides a mechanism for tokenizing a stream
Constructor Summary | |
ExtendedStreamTokenizer(java.io.InputStream inputStream,
boolean eolIsSignificant)
Constructs an ExtendedStreamTokenizer from the given InputStream. |
|
ExtendedStreamTokenizer(java.io.InputStream inputStream,
int commentChar,
boolean eolIsSignificant)
Constructs an ExtendedStreamTokenizer from the given InputStream |
|
ExtendedStreamTokenizer(java.io.Reader reader,
boolean eolIsSignificant)
Constructs an ExtendedStreamTokenizer from the given Reader. |
|
ExtendedStreamTokenizer(java.lang.String path)
Creates and returns a stream tokenizer that has been properly configured to parse sphinx3 data This ExtendedStreamTokenizer has no comment characters. |
|
ExtendedStreamTokenizer(java.lang.String path,
boolean eolIsSignificant)
Creates and returns a stream tokenizer that has been properly configured to parse sphinx3 data This ExtendedStreamTokenizer has no comment characters. |
Method Summary | |
void |
close()
Closes the tokenizer |
void |
commentChar(int ch)
Specified that the character argument starts a single-line comment. |
void |
expectInt(java.lang.String name,
int expecting)
Loads an integer from the tokenizer and ensures that it matches 'expecting' |
void |
expectString(java.lang.String expecting)
Loads a word from the tokenizer and ensures that it matches 'expecting' |
double |
getDouble(java.lang.String name)
gets a double from the tokenizer stream |
float |
getFloat(java.lang.String name)
gets a float from the tokenizer stream |
float |
getFloat(java.lang.String name,
float defaultValue)
gets a optional float from the tokenizer stream. |
int |
getInt(java.lang.String name)
gets an integer from the tokenizer stream |
int |
getLineNumber()
Gets the current line number |
java.lang.String |
getString()
Gets the next word from the tokenizer |
boolean |
isEOF()
Determines if the stream is at the end of file |
void |
skipwhite()
Skip any carriage returns. |
void |
unget(java.lang.String string)
Puts a string back, the next get will return this string |
void |
whitespaceChars(int low,
int hi)
Specifies that all the characters between low and hi incluseive are whitespace characters |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ExtendedStreamTokenizer(java.lang.String path) throws java.io.FileNotFoundException
path
- the source of the data
java.io.FileNotFoundException
- if a file cannot be foundpublic ExtendedStreamTokenizer(java.lang.String path, boolean eolIsSignificant) throws java.io.FileNotFoundException
path
- the source of the dataeolIsSignificant
- if true eol is significant
java.io.FileNotFoundException
- if a file cannot be foundpublic ExtendedStreamTokenizer(java.io.InputStream inputStream, int commentChar, boolean eolIsSignificant)
inputStream
- the source of the datacommentChar
- the comment charactereolIsSignificant
- true if EOL is significant, false otherwisepublic ExtendedStreamTokenizer(java.io.InputStream inputStream, boolean eolIsSignificant)
inputStream
- the source of the dataeolIsSignificant
- true if EOL is significant, false otherwisepublic ExtendedStreamTokenizer(java.io.Reader reader, boolean eolIsSignificant)
reader
- the source of the dataeolIsSignificant
- true if eol is significantMethod Detail |
public void close() throws java.io.IOException
java.io.IOException
- if an error occurs while closing the streampublic void whitespaceChars(int low, int hi)
low
- the low end of the rangehi
- the high end of the rangepublic void commentChar(int ch)
ch
- the comment characterpublic java.lang.String getString() throws java.io.StreamCorruptedException, java.io.IOException
java.io.StreamCorruptedException
- if the word does not match
java.io.IOException
- if an error occurs while loading the datapublic void unget(java.lang.String string)
string
- the string to ungetpublic boolean isEOF()
public int getLineNumber()
public void expectString(java.lang.String expecting) throws java.io.StreamCorruptedException, java.io.IOException
expecting
- the word read must match this
java.io.StreamCorruptedException
- if the word does not match
java.io.IOException
- if an error occurs while loading the datapublic void expectInt(java.lang.String name, int expecting) throws java.io.StreamCorruptedException, java.io.IOException
name
- the name of the valueexpecting
- the word read must match this
java.io.StreamCorruptedException
- if the word does not match
java.io.IOException
- if an error occurs while loading the datapublic int getInt(java.lang.String name) throws java.io.StreamCorruptedException, java.io.IOException
name
- the name of the parameter (for error reporting)
java.io.StreamCorruptedException
- if the next value is not a
java.io.IOException
- if an error occurs while loading the data
numberpublic double getDouble(java.lang.String name) throws java.io.StreamCorruptedException, java.io.IOException
name
- the name of the parameter (for error reporting)
java.io.StreamCorruptedException
- if the next value is not a
java.io.IOException
- if an error occurs while loading the data
numberpublic float getFloat(java.lang.String name) throws java.io.StreamCorruptedException, java.io.IOException
name
- the name of the parameter (for error reporting)
java.io.StreamCorruptedException
- if the next value is not a
java.io.IOException
- if an error occurs while loading the data
numberpublic float getFloat(java.lang.String name, float defaultValue) throws java.io.StreamCorruptedException, java.io.IOException
name
- the name of the parameter (for error reporting)defaultValue
- the default value
java.io.StreamCorruptedException
- if the next value is not a
java.io.IOException
- if an error occurs while loading the data
numberpublic void skipwhite() throws java.io.IOException
java.io.IOException
- if an error occurs while reading data from
the stream.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |