public class CommandList
extends java.lang.Object
GUICommand instances.| Constructor and Description |
|---|
CommandList(@NotNull CommandListType commandListType)
Creates a new instance as an empty command list.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(@NotNull GUICommand guiCommand)
Adds a command to the end of this command list.
|
boolean |
containsCommand(@NotNull java.lang.Class<? extends GUICommand> command)
Returns whether this command list contains a command of the given type.
|
void |
execute()
Execute the command list by calling
GUICommand.execute() for each
command in order. |
@NotNull java.lang.String |
getCommandString()
Returns the commands as a string.
|
@Nullable GUICommand |
getSingleCommand()
Returns the single command of this command list.
|
public CommandList(@NotNull
@NotNull CommandListType commandListType)
commandListType - the command list typepublic void add(@NotNull
@NotNull GUICommand guiCommand)
guiCommand - the command to addpublic void execute()
GUICommand.execute() for each
command in order.@NotNull public @NotNull java.lang.String getCommandString()
public boolean containsCommand(@NotNull
@NotNull java.lang.Class<? extends GUICommand> command)
command - the command type@Nullable public @Nullable GUICommand getSingleCommand()
null if this command list does not
consist of exactly one command