package seedu.jimi.logic.commands;

import seedu.jimi.commons.core.Messages;
import seedu.jimi.commons.core.UnmodifiableObservableList;
import seedu.jimi.model.task.ReadOnlyTask;
import seedu.jimi.model.task.UniqueTaskList.TaskNotFoundException;

/**
 * Deletes a task identified using it's last displayed index from Jimi.
 */
public class DeleteCommand extends Command {

    public static final String COMMAND_WORD = "delete";

    public static final String MESSAGE_USAGE = COMMAND_WORD
            + ": Deletes the task identified by the index number used in the last task listing.\n"
            + "Parameters: INDEX (must be a positive integer)\n"
            + "Example: " + COMMAND_WORD + " 1";

    public static final String MESSAGE_DELETE_TASK_SUCCESS = "Deleted task: %1$s";

    public final int targetIndex;

    public DeleteCommand(int targetIndex) {
        this.targetIndex = targetIndex;
    }


    @Override
    public CommandResult execute() {

        UnmodifiableObservableList<ReadOnlyTask> lastShownList = model.getFilteredTaskList();

        if (lastShownList.size() < targetIndex) {
            indicateAttemptToExecuteIncorrectCommand();
            return new CommandResult(Messages.MESSAGE_INVALID_TASK_DISPLAYED_INDEX);
        }

        ReadOnlyTask taskToDelete = lastShownList.get(targetIndex - 1);

        try {
            model.deleteTask(taskToDelete);
        } catch (TaskNotFoundException pnfe) {
            assert false : "The target task cannot be missing";
        }

        return new CommandResult(String.format(MESSAGE_DELETE_TASK_SUCCESS, taskToDelete));
    }
    
}

@@ -516,30 +516,104 @@
 the 
-task identified by the
+specified task/event from Jimi.%5Cn%22%0A            + %22You can specify the task/event by entering its
  ind
@@ -626,12 +626,13 @@
 ber 
-used
+given
  in 
@@ -644,21 +644,16 @@
 ast 
-task 
 listing.
 %5Cn%22%0A
@@ -648,16 +648,108 @@
 listing.
+ %5Cn%22%0A            + %22If you need to recover your deleted task, you can use the undo command. 
 %5Cn%22%0A    
@@ -925,20 +925,133 @@
  = %22
-Deleted task
+Jimi has deleted this task: %251$s%22;%0A    public static final String MESSAGE_DELETE_EVENT_SUCCESS = %22Jimi has deleted this event
 : %251

Resolve merge conflict in DeleteCommand Class