Class AnonCommand

  • All Implemented Interfaces:
    Command

    public class AnonCommand
    extends CommandImpl
    An anonymous command that takes an anonymous function as a parameter corresponding to the command to execute. The goal of this command is to avoid the creation of a command class for a small cmd.
    Author:
    Arnaud Blouin
    • Constructor Detail

      • AnonCommand

        public AnonCommand​(Runnable cmd)
        Creates the command.
        Parameters:
        cmd - The anonymous command to execute.
    • Method Detail

      • canDo

        public boolean canDo()
        Description copied from interface: Command
        Checks whether the command can be executed.
        Specified by:
        canDo in interface Command
        Overrides:
        canDo in class CommandImpl
        Returns:
        True if the command can be executed.
      • doCmdBody

        protected void doCmdBody()
        Description copied from class: CommandImpl
        This method contains the statements to execute the command. This method is automatically called by DoIt and must not be called explicitly.
        Specified by:
        doCmdBody in class CommandImpl