src/main/java/seedu/taskmanager/model/task/UniqueTaskList.java
/**
     * Adds a task to the list.
     *
     * @throws DuplicateTaskException
     *             if the task to add is a duplicate of an existing task in the
     *             list.
     */
Adds a task to the list.
@throws DuplicateTaskException
if the task to add is a duplicate of an existing task in the
list.
Adds a task to the list . @throws DuplicateTaskException if the task to add is a duplicate of an existing task in the list .
public int add(Task toAdd) throws DuplicateTaskException {
        assert toAdd != null;
        if (contains(toAdd)) {
            throw new DuplicateTaskException();
        }
        int addIndex = findSortedPositionToAdd(toAdd);
        int numMarkedTasks = findNumMarkedTasksBeforeUpdateIndex(addIndex);
        internalList.add(addIndex, toAdd);
        return addIndex - numMarkedTasks;
    }
public int add ( Task toAdd ) throws DuplicateTaskException { assert toAdd != null ; if ( contains ( toAdd ) ) { throw new DuplicateTaskException ( ) ; } int addIndex = findSortedPositionToAdd ( toAdd ) ; int numMarkedTasks = findNumMarkedTasksBeforeUpdateIndex ( addIndex ) ; internalList . add ( addIndex , toAdd ) ; return addIndex - numMarkedTasks ; }
Adds a task to the list.
Adds a task to the list .