forked from nus-cs2103-AY2021S1/tp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request nus-cs2103-AY2021S1#77 from claraadora/autosort
Implement Autosort for Meeting
- Loading branch information
Showing
7 changed files
with
69 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/main/java/seedu/address/model/meeting/util/MeetingComparator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package seedu.address.model.meeting.util; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.Comparator; | ||
|
||
import seedu.address.model.meeting.meeting.Meeting; | ||
|
||
/** | ||
* Represents a Comparator for Meeting which sorts by From. | ||
*/ | ||
public class MeetingComparator implements Comparator<Meeting> { | ||
/** | ||
* Compares Meetings by From in ascending order. | ||
*/ | ||
public int compare(Meeting a, Meeting b) { | ||
LocalDateTime aFrom = a.getFromLocalDateTime(); | ||
LocalDateTime bFrom = b.getFromLocalDateTime(); | ||
|
||
return aFrom.compareTo(bFrom); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters