java.lang.Object
fibrous.fi.FiCommand
The base class which should be extended by all other commands.
You must override the
execute()
method to perform whatever action that is needed.
You must define the commandString (what input is needed to execute the command).
Once a new command class has been created, it must be instantiated and added to the FiCLI
.
Whenever input is passed to the InputParser, if it matches the command string, the execute method will run.
Define the String commandDescription
to either provide help, show a description, or an example on how to use the command.- Author:
- noahm
-
Field Summary
Modifier and TypeFieldDescriptionA list of arguments derived from the input.The description of the command.boolean
Change this to false if you don't want a command to be listed. -
Constructor Summary
-
Method Summary
-
Field Details
-
commandString
-
arguments
A list of arguments derived from the input. -
commandDescription
The description of the command. Shown when all of the commands are listed. -
isVisible
public boolean isVisibleChange this to false if you don't want a command to be listed.
-
-
Constructor Details
-
FiCommand
You must determine what string this command will respond to (the commandString parameter).- Parameters:
commandString
-
-
-
Method Details
-
execute
public abstract void execute()Override this method to perform whatever function is needed. -
isCommand
Determines if the command that was passed matches the defined command string. Fills the arguments ArrayList if it contains any arguments.- Parameters:
cString
-- Returns:
-