Package commandManagers.commands
Class Info
java.lang.Object
commandManagers.Command
commandManagers.commands.Info
- All Implemented Interfaces:
CommandInterface
Class Info provides information about the collection:
the type of the collection, the date of its initialization, and the number of elements it contains.
Extends the Command class.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
checkArgument
(Object inputArgument) Checks if the argument of the Info command is null.void
execute()
Overrides the method execute() in the Command class.getDescr()
Base method for show command description.getName()
Base method for show command nameMethods inherited from class commandManagers.Command
getArgument, isHasArgument, setArgument
-
Constructor Details
-
Info
public Info()
-
-
Method Details
-
getName
Description copied from class:Command
Base method for show command name- Specified by:
getName
in interfaceCommandInterface
- Specified by:
getName
in classCommand
- Returns:
- command name
-
getDescr
Description copied from class:Command
Base method for show command description.- Specified by:
getDescr
in interfaceCommandInterface
- Specified by:
getDescr
in classCommand
- Returns:
- command description
-
execute
public void execute()Overrides the method execute() in the Command class. Prints the type of the collection, the date of its initialization, and the number of elements it contains. Checks the argument before execution.- Specified by:
execute
in interfaceCommandInterface
- Specified by:
execute
in classCommand
-
checkArgument
Checks if the argument of the Info command is null. If the argument is not null, prints a message to the console indicating that the Info command does not take any arguments. Overrides the checkArgument() method of the Command class.- Specified by:
checkArgument
in interfaceCommandInterface
- Specified by:
checkArgument
in classCommand
- Parameters:
inputArgument
- the argument of the Info command- Returns:
- true if the inputArgument is null, false otherwise
-