com.billpringle.utils
Class WrpKeyboard

java.lang.Object
  extended by com.billpringle.utils.WrpKeyboard

public class WrpKeyboard
extends java.lang.Object

This class provides the ability to perform a readLine operation for a Java console application.

Creative Commons License Creative Commons License Symbols Unless noted otherwise, all materials available for download from my site are copyrighted by Bill Pringle, and are licensed under a Creative Commons License.

Author:
Bill Pringle

Field Summary
private  java.io.BufferedReader kbd
          maps to System.in, the user's keyboard
 
Constructor Summary
WrpKeyboard()
          Default (and only) constructor.
 
Method Summary
 java.io.BufferedReader getBufferedReader()
          Return the buffered reader.
static void main(java.lang.String[] args)
          Test driver for the class.
 java.lang.String readLine()
          Read a line from the user's keyboard.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

kbd

private java.io.BufferedReader kbd
maps to System.in, the user's keyboard

Constructor Detail

WrpKeyboard

public WrpKeyboard()
Default (and only) constructor.

This method opens the System.in input stream as a buffered reader, allowing the user to perform a readLine operation on the keyboard.

Method Detail

readLine

public java.lang.String readLine()
                          throws java.io.IOException
Read a line from the user's keyboard. Since kbd is a buffered reader, it can accept the readLine() method.

Returns:
the line from the user
Throws:
java.io.IOException

getBufferedReader

public java.io.BufferedReader getBufferedReader()
Return the buffered reader.

This method can be used to obtain the buffered reader. The client can then perform whatever operations are desired.

Returns:
the buffered reader

main

public static void main(java.lang.String[] args)
Test driver for the class. This method is mainly used for testing purposes.

Parameters:
args - not used