Class ShellUserTerminal

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

public class ShellUserTerminal extends Object implements UserTerminal
An implementation of UserTerminal that uses the shell terminal via System.in and System.out.
Author:
Tobias Downer
  • Constructor Details

    • ShellUserTerminal

      public ShellUserTerminal()
  • Method Details

    • print

      public void print(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(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(String question, 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