|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectEasyReader
public class EasyReader
Constructor Summary | |
---|---|
EasyReader()
Constructs an EasyReader associated with
System.in . |
|
EasyReader(java.lang.String fileName)
Constructs an EasyReader associated with a file for reading. |
Method Summary | |
---|---|
boolean |
bad()
Checks the status of the file. |
void |
close()
Closes the file. |
boolean |
eof()
Checks the EOF status of the file. |
char |
readChar()
Reads the next character from the file (any character including a space or a newline character). |
double |
readDouble()
Reads the next double (without validating its format). |
int |
readInt()
Reads the next integer (without validating its format). |
java.lang.String |
readLine()
Reads from the current position in the file up to and including the next newline character. |
java.lang.String |
readWord()
Skips whitespace and reads the next word (a contiguous string of non-whitespace characters), up to but excluding the next space, newline, etc. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EasyReader()
EasyReader
associated with
System.in
.
public EasyReader(java.lang.String fileName)
EasyReader
associated with a file for reading.
fileName
- the name or pathname of the file.Method Detail |
---|
public void close()
public boolean bad()
public boolean eof()
public char readChar()
null
character
(Unicode 0) if trying to read beyond the EOF.public java.lang.String readLine()
public java.lang.String readWord()
public int readInt()
public double readDouble()
Double.NaN
, if trying to read
beyond the EOF, or if the token read does not represent a valid double.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |