|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.cmu.sphinx.util.ExtendedStreamTokenizer
public class 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 found
public 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 found
public ExtendedStreamTokenizer(java.io.InputStream inputStream,
int commentChar,
boolean eolIsSignificant)
inputStream - the source of the datacommentChar - the comment charactereolIsSignificant - true if EOL is significant, false otherwise
public ExtendedStreamTokenizer(java.io.InputStream inputStream,
boolean eolIsSignificant)
inputStream - the source of the dataeolIsSignificant - true if EOL is significant, false otherwise
public ExtendedStreamTokenizer(java.io.Reader reader,
boolean eolIsSignificant)
reader - the source of the dataeolIsSignificant - true if eol is significant| Method Detail |
|---|
public void close()
throws java.io.IOException
java.io.IOException - if an error occurs while closing the stream
public 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 character
public java.lang.String getString()
throws 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.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 data
public void expectInt(java.lang.String name,
int expecting)
throws 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 data
public int getInt(java.lang.String name)
throws 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 number
public double getDouble(java.lang.String name)
throws 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 number
public float getFloat(java.lang.String name)
throws 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 number
public float getFloat(java.lang.String name,
float defaultValue)
throws 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 number
public 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 | ||||||||