src/main/java/seedu/taskmanager/model/task/UniqueTaskList.java
/**
     * Updates the task in the list at position {@code index} 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 index} < 0 or >= the size of the list.
     */
Updates the task in the list at position  index with
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  index < 0 or >= the size of the list.
Updates the task in the list at position index with 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 index < 0 or > = the size of the list .
public int updateTask(int index, ReadOnlyTask editedTask) throws DuplicateTaskException {
        assert editedTask != null;
        Task taskToUpdate = internalList.get(index);
        if (!taskToUpdate.equals(editedTask) && internalList.contains(editedTask)) {
            throw new DuplicateTaskException();
        }
        taskToUpdate.resetData(editedTask);
        internalList.remove(index);
        int updateIndex = findSortedPositionToAdd(taskToUpdate);
        int numMarkedTasks = findNumMarkedTasksBeforeUpdateIndex(updateIndex);
        internalList.add(updateIndex, taskToUpdate);
        return updateIndex - numMarkedTasks;
    }
public int updateTask ( int index , ReadOnlyTask editedTask ) throws DuplicateTaskException { assert editedTask != null ; Task taskToUpdate = internalList . get ( index ) ; if ( ! taskToUpdate . equals ( editedTask ) && internalList . contains ( editedTask ) ) { throw new DuplicateTaskException ( ) ; } taskToUpdate . resetData ( editedTask ) ; internalList . remove ( index ) ; int updateIndex = findSortedPositionToAdd ( taskToUpdate ) ; int numMarkedTasks = findNumMarkedTasksBeforeUpdateIndex ( updateIndex ) ; internalList . add ( updateIndex , taskToUpdate ) ; return updateIndex - numMarkedTasks ; }
Updates the task in the list at position {@code index} with
 {@code editedTask}.
Updates the task in the list at position { @code index } with { @code editedTask } .