com.realtime.crossfire.jxclient.gui.commands
Class CommandList

java.lang.Object
  extended by com.realtime.crossfire.jxclient.gui.commands.CommandList

public class CommandList
extends java.lang.Object

A list of GUICommand instances.


Field Summary
private  java.util.Collection<GUICommand> commandList
          The list of GUICommands in execution order.
private  CommandListType commandListType
          The command list type.
 
Constructor Summary
CommandList(CommandListType commandListType)
          Creates a new instance as an empty command list.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

commandList

@NotNull
private final java.util.Collection<GUICommand> commandList
The list of GUICommands in execution order.


commandListType

@NotNull
private final CommandListType commandListType
The command list type.

Constructor Detail

CommandList

public CommandList(@NotNull
                   CommandListType commandListType)
Creates a new instance as an empty command list.

Parameters:
commandListType - the command list type
Method Detail

add

public void add(@NotNull
                GUICommand guiCommand)
Adds a command to the end of this command list.

Parameters:
guiCommand - the command to add

canExecute

private boolean canExecute()
Returns whether execution is possible.

Returns:
whether execution is possible

execute

public void execute()
Execute the command list by calling GUICommand.execute() for each command in order.


getCommandString

@NotNull
public java.lang.String getCommandString()
Returns the commands as a string.

Returns:
the commands as a string