Class NumberedListInputScene
java.lang.Object
com.calebleavell.textinterface.scenes.GenericScene
com.calebleavell.textinterface.scenes.NumberedListInputScene
- All Implemented Interfaces:
Function
,Inputtable<Integer>
,Scene
NumberedListInputScene
Presents a list of items to choose from, then the user picks an option based on the corresponding number
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class com.calebleavell.textinterface.scenes.GenericScene
MAX_ITERATIONS_ON_TOSTRING
-
Constructor Summary
ConstructorsConstructorDescriptionReturn a new instance based on the builder fields -
Method Summary
Modifier and TypeMethodDescriptiongetInput()
Getter for the input collected from the uservoid
run()
Execute the program in the following order: 1.void
setInputGetter
(TextInputScene inputGetter) Set the input collectorvoid
setList
(NumberedListScene numberedList) Set the NumberedListMethods inherited from class com.calebleavell.textinterface.scenes.GenericScene
addChild, executeFunctions, getChild, getChild, getChild, getChild, getChildren, getFunctions, getID, getName, isTerminated, runChildren, setChildren, setName, terminate, toString, toString
-
Constructor Details
-
NumberedListInputScene
Return a new instance based on the builder fields- Parameters:
builder
- The new NumberedListInputScene
-
-
Method Details
-
getNumberedList
- Returns:
- The NumberedList of options
-
setList
Set the NumberedList- Parameters:
numberedList
- The new NumberedList
-
getInputGetter
- Returns:
- The input collector, not the input itself
-
setInputGetter
Set the input collector- Parameters:
inputGetter
- The new input collector
-
getInput
Description copied from interface:Inputtable
Getter for the input collected from the user- Specified by:
getInput
in interfaceInputtable<Integer>
- Returns:
- The user's input
-
run
Execute the program in the following order: 1. Numbered List 2. Get Input 3. Run super - runs children and functions- Specified by:
run
in interfaceFunction
- Overrides:
run
in classGenericScene
- Throws:
Exception
-