|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--tio.ReadInput
The class ReadInput contains methods that
allow for simple input of numbers, strings and
characters from a text stream.
| Constructor Summary | |
ReadInput(java.io.InputStream input)
Constructs a ReadInput object for reading from any InputStream. |
|
ReadInput(java.io.Reader input)
Constructs a ReadInput object for reading from any Reader object. |
|
ReadInput(java.lang.String filename)
Constructs a ReadInput object for reading from a file. |
|
| Method Summary | |
boolean |
hasMoreElements()
Check to see if there are any non-white space characters left in the input. |
int |
readChar()
Read the next character. |
int |
readCharNonwhite()
Read the next nonwhite character. |
double |
readDouble()
Attempt to interpret the next white space delimited input characters as a double. |
float |
readFloat()
Attempt to interpret the next white space delimited input characters as a float. |
int |
readInt()
Attempt to interpret the next white space delimited input characters as an int. |
java.lang.String |
readLine()
Read the next complete input line up to the newline character. |
java.lang.String |
readLineNonwhite()
Read the next line that contains at least one, nonwhite character. |
long |
readLong()
Attempt to interpret the next white space delimited input characters as a long. |
java.lang.String |
readWord()
Read the next white space delimited string. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public ReadInput(java.io.Reader input)
input - the Reader text stream to read from.public ReadInput(java.lang.String filename)
filename - the name of the file from which
to read.public ReadInput(java.io.InputStream input)
input - the InputStream to read from.| Method Detail |
public boolean hasMoreElements()
public int readChar()
public double readDouble()
public float readFloat()
public int readInt()
public java.lang.String readLine()
public long readLong()
public java.lang.String readWord()
public java.lang.String readLineNonwhite()
public int readCharNonwhite()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||