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.


Constructor Index

 o Keyboard()

Method Index

 o eof()
 o readChar()
reads first char found in the input "stream", including whitespace.
 o readDouble()
reads first double found in the input "stream", discards the rest of the line; Ignores initial whitespace.
 o readInt()
reads first int found in the input "stream", discards the rest of the line; Ignores initial whitespace.
 o readString()
reads the next line in the input "stream", returns it as a java String.

Constructors

 o Keyboard
 public Keyboard()

Methods

 o 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
 o readChar
 public static char readChar()
reads first char found in the input "stream", including whitespace.

Returns:
the char, or (char)0 if at EOF
 o 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
 o 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
 o eof
 public static boolean eof()

All Packages  Class Hierarchy  This Package  Previous  Next  Index