public class CommandList
extends java.lang.Object
GUICommand
instances.Modifier and Type | Field and Description |
---|---|
private java.util.Collection<GUICommand> |
commandList
The list of
GUICommands in execution order. |
private CommandListType |
commandListType
The command list type.
|
Constructor and Description |
---|
CommandList(CommandListType commandListType)
Creates a new instance as an empty command list.
|
Modifier and Type | Method and Description |
---|---|
void |
add(GUICommand guiCommand)
Adds a command to the end of this command list.
|
private boolean |
canExecute()
Returns whether execution is possible.
|
void |
execute()
Execute the command list by calling
GUICommand.execute() for each
command in order. |
java.lang.String |
getCommandString()
Returns the commands as a string.
|
@NotNull private final java.util.Collection<GUICommand> commandList
GUICommands
in execution order.@NotNull private final CommandListType commandListType
public CommandList(@NotNull CommandListType commandListType)
commandListType
- the command list typepublic void add(@NotNull GUICommand guiCommand)
guiCommand
- the command to addprivate boolean canExecute()
public void execute()
GUICommand.execute()
for each
command in order.@NotNull public java.lang.String getCommandString()