Interface UserInterface


public interface UserInterface

Interface describing abstract user interaction operations. This interface is implemented by the graphical and text UIs for the game. Your QuestionTree interacts with the UI through this interface.


 
Method Summary
 java.lang.String ask(java.lang.String question)
          Prompts the user the given question, waits for the user to input an answer, and returns that answer as a String.
 void println(java.lang.String message)
           
 boolean yesNo(java.lang.String question)
          Prompts the user the given question, waits for the user to input a yes/no answer, and returns that answer as a boolean value.
 

Method Detail

ask

java.lang.String ask(java.lang.String question)
Prompts the user the given question, waits for the user to input an answer, and returns that answer as a String.

Parameters:
question - The question to ask. Assumes not null.
Returns:
the answer typed by the user as a String (empty string if no answer typed)

println

void println(java.lang.String message)

yesNo

boolean yesNo(java.lang.String question)
Prompts the user the given question, waits for the user to input a yes/no answer, and returns that answer as a boolean value.

Parameters:
question - The question to ask. Assumes not null.
Returns:
the answer typed by the user as a boolean (yes is true, no is false)