Class ListFormat<TOption>

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

    public class ListFormat<TOption>
    extends java.lang.Object
    implements PromptFormatter
    A prompt formatter that presents a list of options

    This will format the options as a list, using columns

    • Field Summary

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

      Constructors 
      Constructor Description
      ListFormat()
      Creates a new list format with default columns
      ListFormat​(int columns)
      Creates a new list format with the specified number of 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

      • ListFormat

        public ListFormat()
        Creates a new list format with default columns
      • ListFormat

        public ListFormat​(int columns)
        Creates a new list format with the specified number of columns
        Parameters:
        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