Package commandManagers.commands
Class History
java.lang.Object
commandManagers.Command
commandManagers.commands.History
- All Implemented Interfaces:
CommandInterface
Command that prints the command history
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addToCommandsHistoryQueue
(String command) Adds a command to the command history queueboolean
checkArgument
(Object inputArgument) Checks whether the argument is valid for the History commandvoid
execute()
Executes the History commandgetDescr()
Base method for show command description.getName()
Base method for show command namestatic void
Initializes the command history queuestatic void
Prints the command historyMethods inherited from class commandManagers.Command
getArgument, isHasArgument, setArgument
-
Constructor Details
-
History
public History()
-
-
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()Executes the History command- Specified by:
execute
in interfaceCommandInterface
- Specified by:
execute
in classCommand
-
checkArgument
Checks whether the argument is valid for the History command- Specified by:
checkArgument
in interfaceCommandInterface
- Specified by:
checkArgument
in classCommand
- Parameters:
inputArgument
- the argument to check- Returns:
- true if the argument is null, false otherwise
-
printHistory
public static void printHistory()Prints the command history -
initializeCommandsHistoryQueue
public static void initializeCommandsHistoryQueue()Initializes the command history queue -
addToCommandsHistoryQueue
Adds a command to the command history queue- Parameters:
command
- the command to add
-