|
Java 2 Platform v1.3 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.umich.visualsoar.util.ReaderUtils
These are some utilities that I wrote to ease the reading in of files
Constructor Summary | |
private |
ReaderUtils()
|
Method Summary | |
static void |
copy(java.io.Writer w,
java.io.Reader r)
This function takes all data from a reader, and writes it to a writer a byte at a time |
static float |
getFloat(java.io.Reader r)
This gets a float out of the reader |
static int |
getInteger(java.io.Reader r)
This gets an Integer out of the reader |
static java.lang.String |
getLine(java.io.Reader r)
This gets a line out of the reader |
static java.lang.String |
getWord(java.io.Reader r)
a word is defined as non-whitespace characters terminated by a whitespace character |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
private ReaderUtils()
Method Detail |
public static java.lang.String getWord(java.io.Reader r) throws java.io.IOException
r
- the reader from which the user wants the word extracted
java.io.IOException
- represents something went wrong reading the streampublic static int getInteger(java.io.Reader r) throws java.io.IOException, java.lang.NumberFormatException
r
- the reader from which the user wants the integer extracted
java.io.IOException
- if there was an error reading from the reader
java.lang.NumberFormatException
- if the integer in the reader isn't properly formattedpublic static float getFloat(java.io.Reader r) throws java.io.IOException, java.lang.NumberFormatException
r
- the reader from which the user wants the float extracted
java.io.IOException
- if there was an error reading from the reader
java.lang.NumberFormatException
- if the float in the reader isn't properly formattedpublic static java.lang.String getLine(java.io.Reader r) throws java.io.IOException
r
- the reader from which the user
java.io.IOException
- if there was an error reading from the readerpublic static void copy(java.io.Writer w, java.io.Reader r) throws java.io.IOException
w
- the destinationr
- the source
java.io.IOException
- if there was an error reading from the source or writing to the destination
|
Java 2 Platform v1.3 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |