package seedu.address.model;

import java.util.Set;
import java.util.Stack;

import seedu.address.commons.core.Config;
import seedu.address.commons.core.UnmodifiableObservableList;
import seedu.address.model.tag.UniqueTagList.DuplicateTagException;
import seedu.address.model.task.ReadOnlyTask;
import seedu.address.model.task.Task;
import seedu.address.model.task.UniqueTaskList;
import seedu.address.model.task.UniqueTaskList.DuplicateTaskException;

/**
 * The API of the Model component.
 */
public interface Model {

    Stack<String> getUndoStack();
    Stack<ReadOnlyTask> getDeletedStackOfTasksAdd();
    Stack<ReadOnlyTask> getDeletedStackOfTasks();
    Stack<Integer> getDeletedStackOfTasksIndex();

    /** Clears existing backing model and replaces with the provided new data.
     * @throws DuplicateTaskException
     * @throws DuplicateTagException */
    void resetData(ReadOnlyAddressBook newData);

    /** Returns the AddressBook */
    ReadOnlyAddressBook getAddressBook();

    /**Returns the config*/
    Config getConfig();

    /** Raises an event to indicate the model has changed */
    void updateFileLocation();

    /** Deletes the given task. */
    int deleteTask(ReadOnlyTask target) throws UniqueTaskList.TaskNotFoundException;

    /** Adds the given task */
    void addTask(Task task) throws UniqueTaskList.DuplicateTaskException;

    void revertData();

    /**
     * Updates the task located at {@code filteredTaskListIndex} with {@code editedTask}.
     *
     * @throws DuplicateTaskException if updating the task's details causes the task to be equivalent to
     *      another existing task in the list.
     * @throws IndexOutOfBoundsException if {@code filteredTaskListIndex} < 0 or >= the size of the filtered list.
     */
    void updateTask(int filteredTaskListIndex, ReadOnlyTask editedTask)
            throws UniqueTaskList.DuplicateTaskException;

    /** Returns the filtered task list as an {@code UnmodifiableObservableList<ReadOnlyTask>} */
    UnmodifiableObservableList<ReadOnlyTask> getFilteredTaskList();

    /** Updates the filter of the filtered person list to show all persons */
    void updateFilteredListToShowAll();

    /** Updates the filter of the filtered person list to filter by the given keywords*/
    void updateFilteredTaskList(boolean isInContent, Set<String> keywords);


}

@@ -444,16 +444,86 @@
 ception;
+%0Aimport seedu.address.model.task.UniqueTaskList.TaskNotFoundException;
 %0A%0A/**%0A *
@@ -585,16 +585,41 @@
 odel %7B%0A%0A
+    //@@author A0125221Y%0A
     Stac
@@ -743,24 +743,24 @@
 kOfTasks();%0A
-
     Stack%3CIn
@@ -796,16 +796,195 @@
 Index();
+%0A    Stack%3CReadOnlyTask%3E getOldNextTask();%0A    Stack%3CReadOnlyTask%3E getNewNextTask();%0A    Stack%3CReadOnlyTask%3E getOldTask();%0A    Stack%3CReadOnlyTask%3E getCurrentTask();%0A    //@@author
 %0A%0A    /*
@@ -2162,32 +2162,140 @@
 TaskException;%0A%0A
+    void updateTask(ReadOnlyTask old, Task toUpdate) throws TaskNotFoundException, DuplicateTaskException;%0A%0A
     /** Returns 
@@ -2728,12 +2728,10 @@
 words);%0A
-%0A%0A
 %7D%0A

Update Model.java