java.lang.Object
com.realtime.crossfire.jxclient.gui.commandlist.CommandList

public class CommandList extends Object
A list of GUICommand instances.
  • Constructor Details

    • CommandList

      public CommandList(@NotNull @NotNull CommandListType commandListType)
      Creates a new instance as an empty command list.
      Parameters:
      commandListType - the command list type
  • Method Details

    • add

      public void add(@NotNull @NotNull GUICommand guiCommand)
      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 calling GUICommand.execute() for each command in order.
    • getCommandString

      @NotNull public @NotNull String getCommandString()
      Returns the commands as a string.
      Returns:
      the commands as a string
    • containsCommand

      public boolean containsCommand(@NotNull @NotNull Class<? extends GUICommand> command)
      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

      @Nullable public @Nullable GUICommand getSingleCommand()
      Returns the single command of this command list.
      Returns:
      the single command or null if this command list does not consist of exactly one command