sheffield
Class EasyReader

java.lang.Object
  |
  +--java.io.Reader
        |
        +--java.io.BufferedReader
              |
              +--sheffield.EasyReader

public class EasyReader
extends java.io.BufferedReader


Fields inherited from class java.io.Reader
lock
 
Constructor Summary
EasyReader()
          Create a new EasyReader that reads from standard input
EasyReader(java.lang.String s)
          Create a new EasyReader that reads from a text file
 
Method Summary
 boolean eof()
          Check whether the end of the input stream has been reached
 boolean readBoolean()
          Read a boolean from the input stream
 boolean readBoolean(java.lang.String s)
          Read a boolean from the input stream, with a prompt
 char readChar()
          Read a character from the input stream
 char readChar(java.lang.String s)
          Read a character from the input stream, with a prompt
 double readDouble()
          Read a double from the input stream
 double readDouble(java.lang.String s)
          Read a double from the input stream, with a prompt
 float readFloat()
          Read a float from the input stream
 float readFloat(java.lang.String s)
          Read a float from the input stream, with a prompt
 int readInt()
          Read an integer from the input stream
 int readInt(java.lang.String s)
          Read an integer from the input stream, with a prompt
 java.lang.String readString()
          Read a string from the input stream
 java.lang.String readString(java.lang.String s)
          Read a string from the input stream, with a prompt
 
Methods inherited from class java.io.BufferedReader
close, mark, markSupported, read, read, readLine, ready, reset, skip
 
Methods inherited from class java.io.Reader
read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EasyReader

public EasyReader()
Create a new EasyReader that reads from standard input

EasyReader

public EasyReader(java.lang.String s)
Create a new EasyReader that reads from a text file
Parameters:
s - the name of the text file
Method Detail

eof

public boolean eof()
Check whether the end of the input stream has been reached
Returns:
true if the end of the stream is reached

readChar

public char readChar()
Read a character from the input stream
Returns:
a character value

readChar

public char readChar(java.lang.String s)
Read a character from the input stream, with a prompt
Parameters:
s - the prompt
Returns:
a character value

readString

public java.lang.String readString()
Read a string from the input stream
Returns:
a string value

readString

public java.lang.String readString(java.lang.String s)
Read a string from the input stream, with a prompt
Returns:
a string value

readDouble

public double readDouble()
Read a double from the input stream
Returns:
a double value

readDouble

public double readDouble(java.lang.String s)
Read a double from the input stream, with a prompt
Returns:
a double value

readFloat

public float readFloat()
Read a float from the input stream
Returns:
a float value

readFloat

public float readFloat(java.lang.String s)
Read a float from the input stream, with a prompt
Returns:
a float value

readInt

public int readInt()
Read an integer from the input stream
Returns:
an integer value

readInt

public int readInt(java.lang.String s)
Read an integer from the input stream, with a prompt
Returns:
an integer value

readBoolean

public boolean readBoolean()
Read a boolean from the input stream
Returns:
a boolean value

readBoolean

public boolean readBoolean(java.lang.String s)
Read a boolean from the input stream, with a prompt
Returns:
a boolean value