org.rlcommunity.rlglue.codec.installer
Class ConsoleReader

java.lang.Object
  extended by org.rlcommunity.rlglue.codec.installer.ConsoleReader

public class ConsoleReader
extends java.lang.Object

A class to read strings and numbers from an input stream. This class is suitable for beginning Java programmers. It constructs the necessary buffered reader, handles I/O exceptions, and converts strings to numbers.


Method Summary
static double readDouble()
          Reads a line of input and converts it into a floating- point number.
static int readInt()
          Reads a line of input and converts it into an integer.
static java.lang.String readLine()
          Reads a line of input.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

readInt

public static int readInt()
Reads a line of input and converts it into an integer. The input line must contain nothing but an integer. Not even added white space is allowed.

Returns:
the integer that the user typed

readDouble

public static double readDouble()
Reads a line of input and converts it into a floating- point number. The input line must contain nothing but a nunber. Not even added white space is allowed.

Returns:
the number that the user typed

readLine

public static java.lang.String readLine()
Reads a line of input. In the (unlikely) event of an IOException, the program terminates.

Returns:
the line of input that the user typed, null at the end of input