Package com.mckoi.util
Class ShellUserTerminal
- java.lang.Object
-
- 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
Constructors Constructor Description ShellUserTerminal()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.
-
-
-
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 interfaceUserTerminal
-
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 interfaceUserTerminal
-
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 interfaceUserTerminal
-
-