Package commandManagers.commands
Class Save
java.lang.Object
commandManagers.Command
commandManagers.commands.Save
- All Implemented Interfaces:
CommandInterface
Save class represents the Save command in the program. When executed, it writes the current
collection to the file.
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class commandManagers.Command
getArgument, isHasArgument, setArgument
-
Constructor Details
-
Save
public Save()
-
-
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 Save command. Writes the current collection to the file.- Specified by:
execute
in interfaceCommandInterface
- Specified by:
execute
in classCommand
-
checkArgument
Checks whether the given argument is valid for this command. Since this command doesn't require an argument, this method always returns true.- Specified by:
checkArgument
in interfaceCommandInterface
- Specified by:
checkArgument
in classCommand
- Parameters:
inputArgument
- the argument to be checked- Returns:
- true since this command doesn't require an argument
-