Interface CommandsInterface

All Known Implementing Classes:
CommandsCollection

public interface CommandsInterface
The CommandsInterface provides methods to manage a collection of commands.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(Command command)
    Add a command to the collection.
    boolean
    Check if the collection contains a command with the specified name.
    Get all commands in the collection.
    Get a command by its name.
    void
    remove(String name)
    Remove a command by its name from the collection.
    int
    Get the size of the collection.
  • Method Details

    • add

      void add(Command command)
      Add a command to the collection.
      Parameters:
      command - The command to add.
    • remove

      void remove(String name)
      Remove a command by its name from the collection.
      Parameters:
      name - The name of the command to remove.
    • size

      int size()
      Get the size of the collection.
      Returns:
      The size of the collection.
    • getAllCommands

      Collection<Command> getAllCommands()
      Get all commands in the collection.
      Returns:
      A collection of all commands.
    • contains

      boolean contains(String name)
      Check if the collection contains a command with the specified name.
      Parameters:
      name - The name of the command to check for.
      Returns:
      true if the collection contains the command, false otherwise.
    • getByName

      Command getByName(String name)
      Get a command by its name.
      Parameters:
      name - The name of the command.
      Returns:
      The command object with the specified name.