Class CommandList
java.lang.Object
com.realtime.crossfire.jxclient.gui.commandlist.CommandList
A list of
GUICommand instances.-
Constructor Summary
ConstructorsConstructorDescriptionCommandList(@NotNull CommandListType commandListType) Creates a new instance as an empty command list. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(@NotNull GUICommand guiCommand) Adds a command to the end of this command list.booleancontainsCommand(@NotNull Class<? extends GUICommand> command) Returns whether this command list contains a command of the given type.voidexecute()Execute the command list by callingGUICommand.execute()for each command in order.@NotNull StringReturns the commands as a string.@Nullable GUICommandReturns the single command of this command list.
-
Constructor Details
-
CommandList
Creates a new instance as an empty command list.- Parameters:
commandListType- the command list type
-
-
Method Details
-
add
Adds a command to the end of this command list.- Parameters:
guiCommand- the command to add
-
execute
public void execute()Execute the command list by callingGUICommand.execute()for each command in order. -
getCommandString
Returns the commands as a string.- Returns:
- the commands as a string
-
containsCommand
Returns whether this command list contains a command of the given type.- Parameters:
command- the command type- Returns:
- whether the command type was found
-
getSingleCommand
Returns the single command of this command list.- Returns:
- the single command or
nullif this command list does not consist of exactly one command
-