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.
Integrate AutoExpenditure with Date and Frequency Classes (#105)
* Add Frequency class * Add in basic functions for Date integration
- Loading branch information
Showing
3 changed files
with
52 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package seedu.address.model.util; | ||
|
||
import java.time.Period; | ||
import java.time.temporal.TemporalAmount; | ||
|
||
/** | ||
* An enum containing commonly used time periods as frequency. | ||
*/ | ||
public enum Frequency { | ||
DAILY(Period.ofDays(1)), WEEKLY(Period.ofDays(7)), FORTNIGHTLY(Period.ofDays(14)), MONTHLY( | ||
Period.ofMonths(1)), QUARTERLY(Period.ofMonths(3)), ANUALLY(Period.ofYears(1)); | ||
|
||
private final TemporalAmount period; | ||
|
||
Frequency(TemporalAmount period) { | ||
this.period = period; | ||
} | ||
|
||
public TemporalAmount getPeriod() { | ||
return period; | ||
} | ||
} |