Class CommandList


  • public class CommandList
    extends java.lang.Object
    A list of GUICommand instances.
    • Constructor Summary

      Constructors 
      Constructor Description
      CommandList​(@NotNull CommandListType commandListType)
      Creates a new instance as an empty command list.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CommandList

        public CommandList​(@NotNull
                           @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
                        @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 java.lang.String getCommandString()
        Returns the commands as a string.
        Returns:
        the commands as a string
      • containsCommand

        public boolean containsCommand​(@NotNull
                                       @NotNull java.lang.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