Skip to content

Commit

Permalink
Add javadoc documentations
Browse files Browse the repository at this point in the history
  • Loading branch information
karenfrilya97 committed Apr 4, 2018
1 parent c02ed6b commit d137827
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/main/java/seedu/address/model/util/DateTimeComparator.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,29 @@
package seedu.address.model.util;

import java.util.Comparator;

import seedu.address.model.activity.Activity;
import seedu.address.model.activity.DateTime;

import java.util.Comparator;

//@@author karenfrilya97
/**
* Comparator class that compares Activity based on dateTime attributes.
* For Event objects, this class only compares based on the startDateTime,
* and does not take into account the endDateTime.
*/
public class DateTimeComparator implements Comparator<Activity> {

public DateTimeComparator () {
}

/**
* Compares two activities
* @param o1 and
* @param o2,
* @return a negative integer, zero, or a positive integer
* if the first activity's dateTime is earlier than, equal to or later than
* the second activity's dateTime respectively.
*/
public int compare(Activity o1, Activity o2) {
DateTime dt1 = o1.getDateTime();
DateTime dt2 = o2.getDateTime();
Expand Down

0 comments on commit d137827

Please sign in to comment.