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 intask(java.lang.String question, java.lang.String[] options, int default_answer)Asks the user a question from the 'question' string.voidprint(java.lang.String str)Outputs a string of information to the terminal.voidprintln(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:UserTerminalOutputs a string of information to the terminal.- Specified by:
printin interfaceUserTerminal
-
println
public void println(java.lang.String str)
Description copied from interface:UserTerminalOutputs a string of information and a newline to the terminal.- Specified by:
printlnin interfaceUserTerminal
-
ask
public int ask(java.lang.String question, java.lang.String[] options, int default_answer)Description copied from interface:UserTerminalAsks 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:
askin interfaceUserTerminal
-
-