src/main/java/seedu/taskmanager/model/task/UniqueTaskList.java
/**
     * Compares the due date of 2 deadline tasks.
     *
     * @return true if 1st deadline task is earlier than the 2nd deadline task
     *         based on the endDate and endTime
     * @return false, if otherwise.
     */
Compares the due date of 2 deadline tasks.
@return true if 1st deadline task is earlier than the 2nd deadline task
based on the endDate and endTime
@return false, if otherwise.
Compares the due date of 2 deadline tasks . @return true if 1st deadline task is earlier than the 2nd deadline task based on the endDate and endTime @return false if otherwise .
private boolean isAddDeadlineEarlierAddListIndex(Task toAdd, ReadOnlyTask readOnlyTask) {
        if (toAdd.getEndDate().value.substring(toAdd.getEndDate().value.length() - 2).compareTo(
                readOnlyTask.getEndDate().value.substring(readOnlyTask.getEndDate().value.length() - 2)) < 0) {
            return true;
        } else {
            if (toAdd.getEndDate().value.substring(toAdd.getEndDate().value.length() - 2).compareTo(
                    readOnlyTask.getEndDate().value.substring(readOnlyTask.getEndDate().value.length() - 2)) == 0) {
                if (toAdd.getEndDate().value
                        .substring(toAdd.getEndDate().value.length() - 5, toAdd.getEndDate().value.length() - 3)
                        .compareTo(
                                readOnlyTask.getEndDate().value.substring(readOnlyTask.getEndDate().value.length() - 5,
                                        readOnlyTask.getEndDate().value.length() - 3)) < 0) {
                    return true;
                } else {
                    if (toAdd.getEndDate().value
                            .substring(toAdd.getEndDate().value.length() - 5, toAdd.getEndDate().value.length() - 3)
                            .compareTo(readOnlyTask.getEndDate().value.substring(
                                    readOnlyTask.getEndDate().value.length()
                                            - 5,
                                    readOnlyTask.getEndDate().value.length() - 3)) == 0) {
                        if (toAdd.getEndDate().value.substring(0, toAdd.getEndDate().value.length() - 6)
                                .compareTo(readOnlyTask.getEndDate().value.substring(0,
                                        readOnlyTask.getEndDate().value.length() - 6)) < 0) {
                            return true;
                        } else {
                            if (toAdd.getEndDate().value.substring(0, toAdd.getEndDate().value.length() - 6)
                                    .compareTo(readOnlyTask.getEndDate().value.substring(0,
                                            readOnlyTask.getEndDate().value.length() - 6)) == 0) {
                                return (toAdd.getEndTime().value.compareTo(readOnlyTask.getEndTime().value) < 0);
                            } else {
                                return false;
                            }
                        }
                    } else {
                        return false;
                    }
                }
            } else {
                return false;
            }
        }
    }
private boolean isAddDeadlineEarlierAddListIndex ( Task toAdd , ReadOnlyTask readOnlyTask ) { if ( toAdd . getEndDate ( ) . value . substring ( toAdd . getEndDate ( ) . value . length ( ) - 2 ) . compareTo ( readOnlyTask . getEndDate ( ) . value . substring ( readOnlyTask . getEndDate ( ) . value . length ( ) - 2 ) ) < 0 ) { return true ; } else { if ( toAdd . getEndDate ( ) . value . substring ( toAdd . getEndDate ( ) . value . length ( ) - 2 ) . compareTo ( readOnlyTask . getEndDate ( ) . value . substring ( readOnlyTask . getEndDate ( ) . value . length ( ) - 2 ) ) == 0 ) { if ( toAdd . getEndDate ( ) . value . substring ( toAdd . getEndDate ( ) . value . length ( ) - 5 , toAdd . getEndDate ( ) . value . length ( ) - 3 ) . compareTo ( readOnlyTask . getEndDate ( ) . value . substring ( readOnlyTask . getEndDate ( ) . value . length ( ) - 5 , readOnlyTask . getEndDate ( ) . value . length ( ) - 3 ) ) < 0 ) { return true ; } else { if ( toAdd . getEndDate ( ) . value . substring ( toAdd . getEndDate ( ) . value . length ( ) - 5 , toAdd . getEndDate ( ) . value . length ( ) - 3 ) . compareTo ( readOnlyTask . getEndDate ( ) . value . substring ( readOnlyTask . getEndDate ( ) . value . length ( ) - 5 , readOnlyTask . getEndDate ( ) . value . length ( ) - 3 ) ) == 0 ) { if ( toAdd . getEndDate ( ) . value . substring ( 0 , toAdd . getEndDate ( ) . value . length ( ) - 6 ) . compareTo ( readOnlyTask . getEndDate ( ) . value . substring ( 0 , readOnlyTask . getEndDate ( ) . value . length ( ) - 6 ) ) < 0 ) { return true ; } else { if ( toAdd . getEndDate ( ) . value . substring ( 0 , toAdd . getEndDate ( ) . value . length ( ) - 6 ) . compareTo ( readOnlyTask . getEndDate ( ) . value . substring ( 0 , readOnlyTask . getEndDate ( ) . value . length ( ) - 6 ) ) == 0 ) { return ( toAdd . getEndTime ( ) . value . compareTo ( readOnlyTask . getEndTime ( ) . value ) < 0 ) ; } else { return false ; } } } else { return false ; } } } else { return false ; } } }
Compares the due date of 2 deadline tasks.
Compares the due date of 2 deadline tasks .