All Packages Class Hierarchy This Package Previous Next Index
Class utils.Keyboard
java.lang.Object
|
+----utils.Keyboard
- public class Keyboard
- extends Object
Keyboard.java - simple console i/o package;
no-frills keyboard input of integers, reals,
strings, and characters.
-
Keyboard()
-
-
eof()
-
-
readChar()
- reads first char found in the input "stream",
including whitespace.
-
readDouble()
- reads first double found in the input "stream",
discards the rest of the line; Ignores initial whitespace.
-
readInt()
- reads first int found in the input "stream",
discards the rest of the line; Ignores initial whitespace.
-
readString()
- reads the next line in the input "stream", returns it
as a java String.
Keyboard
public Keyboard()
readInt
public static int readInt()
- reads first int found in the input "stream",
discards the rest of the line; Ignores initial whitespace.
- Returns:
- the int, or 0 if at EOF
readChar
public static char readChar()
- reads first char found in the input "stream",
including whitespace.
- Returns:
- the char, or (char)0 if at EOF
readDouble
public static double readDouble()
- reads first double found in the input "stream",
discards the rest of the line; Ignores initial whitespace.
- Returns:
- the double, or 0.0 if at EOF
readString
public static String readString()
- reads the next line in the input "stream", returns it
as a java String.
- Returns:
- the String, or null if at EOF
eof
public static boolean eof()
All Packages Class Hierarchy This Package Previous Next Index