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)
-
BasicIo()
-
-
prompt(String)
- output a prompt message to the screen
-
readCharacter()
- read a character, the first on the line
-
readDouble()
- read the next line from the keyboard as a double
-
readFloat()
- read the next line from the keyboard as a float
-
readInteger()
- read the next line from the keyboard as an integer
-
readString()
- read the next line from the keyboard as a String
-
writeDouble(double, int, int)
- output a double in a field of a specified width
-
writeFloat(float, int, int)
- output a float in a field of a specified width
-
writeInteger(int, int)
- output an integer in a field of a specified width
BasicIo
public BasicIo()
prompt
public static void prompt(String s)
- output a prompt message to the screen
- Parameters:
- prompt - message
readString
public static String readString() throws IOException
- read the next line from the keyboard as a String
- Returns:
- the line as a String
readCharacter
public static char readCharacter() throws IOException
- read a character, the first on the line
- Returns:
- the first character on the line
readInteger
public static int readInteger() throws IOException
- read the next line from the keyboard as an integer
- Returns:
- the line as an integer
readFloat
public static float readFloat() throws IOException
- read the next line from the keyboard as a float
- Returns:
- the line as a float
readDouble
public static double readDouble() throws IOException
- read the next line from the keyboard as a double
- Returns:
- the line as a double
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
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
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