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 voidaddToCommandsHistoryQueue(String command) Adds a command to the command history queuebooleancheckArgument(Object inputArgument) Checks whether the argument is valid for the History commandvoidexecute()Executes the History commandgetDescr()Base method for show command description.getName()Base method for show command namestatic voidInitializes the command history queuestatic voidPrints the command historyMethods inherited from class commandManagers.Command
getArgument, isHasArgument, setArgument
-
Constructor Details
-
History
public History()
-
-
Method Details
-
getName
Description copied from class:CommandBase method for show command name- Specified by:
getNamein interfaceCommandInterface- Specified by:
getNamein classCommand- Returns:
- command name
-
getDescr
Description copied from class:CommandBase method for show command description.- Specified by:
getDescrin interfaceCommandInterface- Specified by:
getDescrin classCommand- Returns:
- command description
-
execute
public void execute()Executes the History command- Specified by:
executein interfaceCommandInterface- Specified by:
executein classCommand
-
checkArgument
Checks whether the argument is valid for the History command- Specified by:
checkArgumentin interfaceCommandInterface- Specified by:
checkArgumentin 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
-