All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.lancs.BasicIo

java.lang.Object
   |
   +----java.lancs.BasicIo

public class BasicIo
extends Object
simple methods for basic input/output (Java 1.1)


Constructor Index

 o BasicIo()

Method Index

 o prompt(String)
output a prompt message to the screen
 o readCharacter()
read a character, the first on the line
 o readDouble()
read the next line from the keyboard as a double
 o readFloat()
read the next line from the keyboard as a float
 o readInteger()
read the next line from the keyboard as an integer
 o readString()
read the next line from the keyboard as a String
 o writeDouble(double, int, int)
output a double in a field of a specified width
 o writeFloat(float, int, int)
output a float in a field of a specified width
 o writeInteger(int, int)
output an integer in a field of a specified width

Constructors

 o BasicIo
 public BasicIo()

Methods

 o prompt
 public static void prompt(String s)
output a prompt message to the screen

Parameters:
prompt - message
 o readString
 public static String readString() throws IOException
read the next line from the keyboard as a String

Returns:
the line as a String
 o readCharacter
 public static char readCharacter() throws IOException
read a character, the first on the line

Returns:
the first character on the line
 o readInteger
 public static int readInteger() throws IOException
read the next line from the keyboard as an integer

Returns:
the line as an integer
 o readFloat
 public static float readFloat() throws IOException
read the next line from the keyboard as a float

Returns:
the line as a float
 o readDouble
 public static double readDouble() throws IOException
read the next line from the keyboard as a double

Returns:
the line as a double
 o writeInteger
 public static void writeInteger(int n,
                                 int w)
output an integer in a field of a specified width

Parameters:
n - the integer to be output
w - the width of the field
 o writeFloat
 public static void writeFloat(float n,
                               int w,
                               int d) throws IOException
output a float in a field of a specified width

Parameters:
n - the float to be output
w - the width of the field
d - the number of decimal places
 o writeDouble
 public static void writeDouble(double n,
                                int w,
                                int d) throws IOException
output a double in a field of a specified width

Parameters:
n - the double to be output
w - the width of the field
d - the number of decimal places

All Packages  Class Hierarchy  This Package  Previous  Next  Index