|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--dwvisser.SimpleTokenReader
Reads in values from a text file separated by whitespace (spaces, tabs, carriage returns & linefeeds). Everything after the # sign on any line is ignored as a comment. Anything between quotation marks (" "), is read in as a single string.
| Constructor Summary | |
SimpleTokenReader(java.io.File f)
Create an instance for reading in the file f. |
|
| Method Summary | |
void |
close()
One may call this to close the underlying file. |
double |
readDouble()
Reads an double from the file, if the next token is a number. |
int |
readInteger()
Reads an integer from the file, if the next token is a number. |
java.lang.String |
readString()
Reads a string from the file, either a single word or the entire between two quotation marks (" "). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SimpleTokenReader(java.io.File f)
throws java.io.IOException
f - text file to read from
java.io.IOException - if something goes wrong opening the file| Method Detail |
public int readInteger()
throws java.io.IOException
java.io.IOException - if the next token is not a number
public double readDouble()
throws java.io.IOException
java.io.IOException - if the next token is not a number
public java.lang.String readString()
throws java.io.IOException
java.io.IOException - if the next token is not a String
public void close()
throws java.io.IOException
java.io.IOException - if there's a problem closing the file
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||