java.lang.Object
com.adventure.commands.AutoCompleter
Singleton that predicts text when pressing tab
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Direction to follow when selecting the next prediction -
Method Summary
Modifier and TypeMethodDescriptionvoid
Decrement the number of times the 'tab' key has been pressedstatic AutoCompleter
Instance getter for the singletonvoid
Increment the number of times the 'tab' key has been pressedvoid
loadCompleter
(String newInput, String previousInput) Gets all possible commands from the initial command inserted by the uservoid
operate
(javafx.beans.property.StringProperty output, javafx.beans.property.StringProperty input, AutoCompleter.direction dir) Obtain and set the input and output Strings
-
Method Details
-
getInstance
Instance getter for the singleton- Returns:
- current instance
-
loadCompleter
Gets all possible commands from the initial command inserted by the user- Parameters:
newInput
- String The input just insertedpreviousInput
- String The partial command found in the input field
-
operate
public void operate(javafx.beans.property.StringProperty output, javafx.beans.property.StringProperty input, AutoCompleter.direction dir) Obtain and set the input and output Strings- Parameters:
output
- TextArea of the output promptinput
- TextFiled for the input promptdir
- Direction to follow when selecting the next prediction
-
incrementCounter
public void incrementCounter()Increment the number of times the 'tab' key has been pressed -
decrementCounter
public void decrementCounter()Decrement the number of times the 'tab' key has been pressed
-