Class QuestionFormat<TOption>

  • Type Parameters:
    TOption - Option type
    All Implemented Interfaces:
    PromptFormatter

    public class QuestionFormat<TOption>
    extends java.lang.Object
    implements PromptFormatter
    Prompt format for simple questions with either a free-form response or with a limited number of options
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int columns  
    • Constructor Summary

      Constructors 
      Constructor Description
      QuestionFormat()
      Creates a new question format with default columns
      QuestionFormat​(int columns)
      Creates a new question format with the specified columns
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T> void displayPrompt​(Prompt<T> prompt)
      Displays the prompt
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • columns

        private final int columns
    • Constructor Detail

      • QuestionFormat

        public QuestionFormat()
        Creates a new question format with default columns
      • QuestionFormat

        public QuestionFormat​(int columns)
        Creates a new question format with the specified columns
        Parameters:
        columns - Columns
    • Method Detail

      • displayPrompt

        public <T> void displayPrompt​(Prompt<T> prompt)
        Description copied from interface: PromptFormatter
        Displays the prompt
        Specified by:
        displayPrompt in interface PromptFormatter
        Type Parameters:
        T - Option type
        Parameters:
        prompt - Prompt