QJCC homepage

biz.chitec.quarterback.util
Class ConsoleWrapper

java.lang.Object
  extended bybiz.chitec.quarterback.util.ConsoleWrapper
All Implemented Interfaces:
ProgressIndicator

public class ConsoleWrapper
extends java.lang.Object
implements ProgressIndicator

Quite dumb abstract console object.

Version:
$Id: 01a2d45539658bf74ccbb9bd5da969dc7095cd14 $
Author:
Dirk Hillbrecht 1997-1999, chitec/Dirk Hillbrecht 2000. Distributed under the terms of the GNU LGPL.

Field Summary
(package private)  java.io.BufferedReader conin
           
(package private)  java.io.BufferedWriter conout
           
(package private)  int row
           
 
Constructor Summary
ConsoleWrapper()
          Initialize console
 
Method Summary
 void print(java.lang.Object o)
          Print out an object (no newline).
 void println()
          Print out single newline.
 void println(java.lang.Object o)
          Print out object with newline.
 java.lang.String readInput(java.lang.String prompt)
          Reads a line of input.
(package private)  void reInit()
          Reinitialize my console.
 int selectMenu(java.lang.String title, java.util.List v)
          Choose from a menu.
 java.lang.String setValue(java.lang.String prompt, java.lang.String defaultvalue)
          Sets a Value, returns given default on empty input.
 void showErrorMessage(java.lang.Object o)
          Shows error message.
 void showMessage(java.lang.Object o)
          Shows message.
 void showProgressStep()
          Shows progress as little dot.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

conin

java.io.BufferedReader conin

conout

java.io.BufferedWriter conout

row

int row
Constructor Detail

ConsoleWrapper

public ConsoleWrapper()
               throws java.io.IOException
Initialize console

Method Detail

print

public void print(java.lang.Object o)
Print out an object (no newline).


println

public void println(java.lang.Object o)
Print out object with newline.


println

public void println()
Print out single newline.


reInit

void reInit()
Reinitialize my console.


selectMenu

public int selectMenu(java.lang.String title,
                      java.util.List v)
Choose from a menu. Menu has given title and items contained in given List. The vector may contain either NumberedStrings or Strings. In the former case, selectMenu() returns the number field of the chosen string rather than its position in the List.


readInput

public java.lang.String readInput(java.lang.String prompt)
                           throws java.io.IOException
Reads a line of input.

Throws:
java.io.IOException

setValue

public java.lang.String setValue(java.lang.String prompt,
                                 java.lang.String defaultvalue)
                          throws java.io.IOException
Sets a Value, returns given default on empty input.

Throws:
java.io.IOException

showProgressStep

public void showProgressStep()
Shows progress as little dot.

Specified by:
showProgressStep in interface ProgressIndicator

showMessage

public void showMessage(java.lang.Object o)
Shows message.

Specified by:
showMessage in interface ProgressIndicator

showErrorMessage

public void showErrorMessage(java.lang.Object o)
Shows error message.

Specified by:
showErrorMessage in interface ProgressIndicator

QJCC homepage