/** @@author A0142130A **/
package seedu.taskell.model;

import seedu.taskell.model.task.Task;

/** Stores the relevant details of a command so it can be undone via UndoCommand
 *  each Add/Delete/Edit Command executed should correspond to a CommandHistory 
 *  stored in UndoCommand's list of CommandHistory
 * */
public class CommandHistory {
    private String commandText, commandType;
    private Task task;  //relevent task to be added, deleted or edited
    private boolean toRedo;
    
    public CommandHistory() {
        commandText = "default command text";
        commandType = "default command type";
        task = null;
    }
    
    public CommandHistory(String commandText, String commandType, Task task) {
        assert commandText != null;
        assert commandType != null;
        assert !commandText.trim().isEmpty();
        assert !commandType.trim().isEmpty();
        
        this.commandText = commandText.trim();
        this.commandType = commandType.trim();
        this.task = task;
    }
    
    public String getCommandText() {
        return commandText;
    }
    
    public String getCommandType() {
        return commandType;
    }
    
    public Task getTask() {
        return task;
    }
    
    public boolean isRedoTrue() {
        return toRedo;
    }
    
    public void setCommandText(String text) {
        this.commandText = text;
    }
    
    public void setTask(Task task) {
        assert task != null;
        this.task = task;
    }
    
    public void setToRedoToTrue() {
        toRedo = true;
    }
    
}

@@ -405,16 +405,20 @@
 sk task;
+    
   //rele
@@ -458,16 +458,78 @@
  edited%0A
+    private Task oldTask;   //oldTask needed for EditCommands%0A
     priv
@@ -692,24 +692,48 @@
 ask = null;%0A
+        toRedo = false;%0A
     %7D%0A    %0A 
@@ -799,19 +799,8 @@
 Type
-, Task task
 ) %7B%0A
@@ -1078,36 +1078,60 @@
     this.task = 
-task
+null;%0A        toRedo = false
 ;%0A    %7D%0A    %0A   
@@ -1331,32 +1331,98 @@
 ask;%0A    %7D%0A    %0A
+    public Task getOldTask() %7B%0A        return oldTask;%0A    %7D%0A    %0A
     public boole
@@ -1465,32 +1465,68 @@
 edo;%0A    %7D%0A    %0A
+    /**** Setter methods ****/%0A    %0A
     public void 
@@ -1694,32 +1694,112 @@
 ask;%0A    %7D%0A    %0A
+    public void setOldTask(Task task) %7B%0A        this.oldTask = task;%0A    %7D%0A    %0A
     public void 

add oldTask attribute and commenting sections