/** A class that prints out messages of various types in several
 * languages.
 *
 * @author Jerod Weinman
 */
public class MultiLingualMessages {

  /**
   * An enumerated type explicitly listing the possible languages.
   */
  public enum Language {English, French, Spanish, Chef};

  /** Object member representing the language */
  private Language lang;

  /** Return the language of this object.
   *
   * @return the language of this object
   */
  public Language getLanguage() { return lang; }

  /** Set the language of this object. */
  public void setLanguage(Language lang) {
    this.lang = lang;
  }

  /** Print a question in the appropriate language */
  public void printQuestion() {

    String msg = "";

    switch(lang) {
    case English: msg = "What?"; break;
    case Spanish:
    case French: msg = "Que?"; break;
    case Chef: msg = "Bork?"; break;
    default: throw new IllegalStateException("Unknown current language.");
    }

    System.out.println(msg);
  }

  /** Print an exclamation in the appropriate language */
  public void printExclamation() {
    
    String msg = "";

    switch(lang) {
    case English: msg = "Whoah!"; break;
    case Spanish: msg = "¡Caramba!"; break;
    case French: msg = "Par bleu!"; break;
    case Chef: msg = "Bork!"; break;
    default: throw new IllegalStateException("Unknown current language.");
    }

    System.out.println(msg);
  }
}