Class RitIo

java.lang.Object
  |
  +--RitIo

public class RitIo
extends java.lang.Object

This class provides a method of reading information from standard input (stdin) while hiding all of the implementation details from the user. The class provides reads for integer, double, float, and string.


Constructor Summary
RitIo()
           
 
Method Summary
static double getDouble()
          Reads a double from stdin using the prompt "Enter a double: "
static double getDouble(java.lang.String prompt)
          Reads a double from stdin using the prompt provided
static float getFloat()
          Reads a float from stdin using the prompt "Enter a float: "
static float getFloat(java.lang.String prompt)
          Reads a float from stdin using the prompt provided
static int getInteger()
          Reads an integer from stdin using the prompt "Enter an integer: "
static int getInteger(java.lang.String prompt)
          Reads an integer from stdin using the prompt provided
static java.lang.String getString()
          Reads a string from stdin using the prompt "Enter a string: "
static java.lang.String getString(java.lang.String prompt)
          Reads a string from stdin using the prompt provided
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RitIo

public RitIo()
Method Detail

getInteger

public static int getInteger()
Reads an integer from stdin using the prompt "Enter an integer: "

Returns:
the integer read

getInteger

public static int getInteger(java.lang.String prompt)
Reads an integer from stdin using the prompt provided

Parameters:
prompt - The prompt to be used to get an integer
Returns:
the integer read

getDouble

public static double getDouble()
Reads a double from stdin using the prompt "Enter a double: "

Returns:
the double read

getDouble

public static double getDouble(java.lang.String prompt)
Reads a double from stdin using the prompt provided

Parameters:
prompt - The prompt to be used to get a double
Returns:
the double read

getFloat

public static float getFloat()
Reads a float from stdin using the prompt "Enter a float: "

Returns:
the float read

getFloat

public static float getFloat(java.lang.String prompt)
Reads a float from stdin using the prompt provided

Parameters:
prompt - The prompt to be used to get a float
Returns:
the float read

getString

public static java.lang.String getString()
Reads a string from stdin using the prompt "Enter a string: "

Returns:
the string read

getString

public static java.lang.String getString(java.lang.String prompt)
Reads a string from stdin using the prompt provided

Parameters:
prompt - The prompt to be used to get a string
Returns:
the string read