Class NumberedListScene

java.lang.Object
com.calebleavell.textinterface.scenes.GenericScene
com.calebleavell.textinterface.scenes.NumberedListScene
All Implemented Interfaces:
Function, Scene

public class NumberedListScene extends GenericScene

NumberedListScene

Displays a Numbered list of items to the user

  • Constructor Details

    • NumberedListScene

      protected NumberedListScene(NumberedListScene.Builder builder)
      Return a new instance based on the builder fields
      Parameters:
      builder - The new NumberedListScene
  • Method Details

    • getList

      public List<TextScene> getList()
      Getter for list
      Returns:
      The list of iteme
    • setList

      public void setList(List<TextScene> list)
      Setter for list
      Parameters:
      list - the new list of items
    • getStartIndex

      public int getStartIndex()
      Getter for startIndex
      Returns:
      The start index
    • setStartIndex

      public void setStartIndex(int startIndex)
      Setter for startIndex
      Parameters:
      startIndex - The new start index
    • convertStringListToTextSceneList

      protected static List<TextScene> convertStringListToTextSceneList(String... strings)
      Converts an array of strings to a List of TextScenes
      Parameters:
      strings - The array of strings (varargs)
      Returns:
      The list of TextScenes
    • run

      public void run() throws Exception
      Executes the program as follows: 1. Display list of items (assuming start index is n) : n: item 1 n + 1: item 2 n + 2: item 3 etc. 2. Runs super - runs children and functions
      Specified by:
      run in interface Function
      Overrides:
      run in class GenericScene
      Throws:
      Exception