Package org.progettoedids.util
Class CommandLogger
java.lang.Object
org.progettoedids.util.CommandLogger
This class is used to record commands executed by the user.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionString[]Returns a copy of the command log as an arrayReturns the last recorded command in the command log.booleanisEmpty()Checks whether the command log is empty.voidLogs a command to the command list.Removes the last recorded command from the command log and returns it.
-
Constructor Details
-
CommandLogger
public CommandLogger()
-
-
Method Details
-
log
Logs a command to the command list.- Parameters:
command- a String representing the command to save. Must not be null
-
getCommandLog
Returns a copy of the command log as an array- Returns:
- an array of String(s)
-
isEmpty
public boolean isEmpty()Checks whether the command log is empty.- Returns:
- true if the command log is empty, false otherwise
-
getLastLog
-
removeLastLog
Removes the last recorded command from the command log and returns it.- Returns:
- a String
-