forked from nus-cs2103-AY1920S1/addressbook-level3
-
Notifications
You must be signed in to change notification settings - Fork 5
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 #178 from Dandford/master
Updating UserDocs
- Loading branch information
Showing
7 changed files
with
281 additions
and
65 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
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
29 changes: 29 additions & 0 deletions
29
src/main/java/seedu/address/model/person/predicates/EntryContainsDatePredicate.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,29 @@ | ||
package seedu.address.model.person.predicates; | ||
|
||
import java.time.LocalDate; | ||
import java.util.function.Predicate; | ||
|
||
import seedu.address.model.person.Entry; | ||
|
||
/** | ||
* Tests that a {@code Entry's}'s {@code LocalDate} matches any of the keywords given. | ||
*/ | ||
public class EntryContainsDatePredicate implements Predicate<Entry> { | ||
private final LocalDate dateToFilter; | ||
|
||
public EntryContainsDatePredicate(LocalDate dateToFilter) { | ||
this.dateToFilter = dateToFilter; | ||
} | ||
|
||
@Override | ||
public boolean test(Entry entry) { | ||
return dateToFilter.equals(entry.getDate().getDate()); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object other) { | ||
return other == this // short circuit if same object | ||
|| (other instanceof EntryContainsDatePredicate // instanceof handles nulls | ||
&& dateToFilter == (((EntryContainsDatePredicate) other).dateToFilter)); // state check | ||
} | ||
} |
Oops, something went wrong.