com.mckoi.util
Class ShellUserTerminal

java.lang.Object
  extended by com.mckoi.util.ShellUserTerminal
All Implemented Interfaces:
UserTerminal

public class ShellUserTerminal
extends java.lang.Object
implements UserTerminal

An implementation of UserTerminal that uses the shell terminal via System.in and System.out.

Author:
Tobias Downer

Constructor Summary
ShellUserTerminal()
           
 
Method Summary
 int ask(java.lang.String question, java.lang.String[] options, int default_answer)
          Asks the user a question from the 'question' string.
 void print(java.lang.String str)
          Outputs a string of information to the terminal.
 void println(java.lang.String str)
          Outputs a string of information and a newline to the terminal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShellUserTerminal

public ShellUserTerminal()
Method Detail

print

public void print(java.lang.String str)
Description copied from interface: UserTerminal
Outputs a string of information to the terminal.

Specified by:
print in interface UserTerminal

println

public void println(java.lang.String str)
Description copied from interface: UserTerminal
Outputs a string of information and a newline to the terminal.

Specified by:
println in interface UserTerminal

ask

public int ask(java.lang.String question,
               java.lang.String[] options,
               int default_answer)
Description copied from interface: UserTerminal
Asks the user a question from the 'question' string. The 'options' list is the list of options that the user may select from. The 'default_answer' is the option that is selected by default.

Specified by:
ask in interface UserTerminal