java.lang.Object
com.adventure.commands.AutoCompleter
Singleton that predicts text when pressing tab
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDirection to follow when selecting the next prediction -
Method Summary
Modifier and TypeMethodDescriptionvoidDecrement the number of times the 'tab' key has been pressedstatic AutoCompleterInstance getter for the singletonvoidIncrement the number of times the 'tab' key has been pressedvoidloadCompleter(String newInput, String previousInput) Gets all possible commands from the initial command inserted by the uservoidoperate(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
-