Package com.ibm.icu.util
Class EasterRule
java.lang.Object
com.ibm.icu.util.EasterRule
- All Implemented Interfaces:
DateRule
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate Date
computeInYear
(Date date, GregorianCalendar cal) Compute the month and date on which this holiday falls in the year containing the date "date".private Date
doFirstBetween
(Date start, Date end) firstAfter
(Date start) Return the first occurrence of this rule on or after the given datefirstBetween
(Date start, Date end) Return the first occurrence of this rule on or after the given start date and before the given end date.boolean
Return true if Easter occurs between the two dates givenboolean
Return true if the given Date is on the same day as Easter
-
Field Details
-
daysAfterEaster
private int daysAfterEaster -
calendar
-
-
Constructor Details
-
EasterRule
public EasterRule(int daysAfterEaster, boolean isOrthodox)
-
-
Method Details
-
firstAfter
Return the first occurrence of this rule on or after the given date- Specified by:
firstAfter
in interfaceDateRule
- Parameters:
start
- Only occurrances on or after this date are returned.- Returns:
- The date on which this event occurs, or null if it does not occur on or after the start date.
- See Also:
-
firstBetween
Return the first occurrence of this rule on or after the given start date and before the given end date.- Specified by:
firstBetween
in interfaceDateRule
- Parameters:
start
- Only occurrances on or after this date are returned.end
- Only occurrances before this date are returned.- Returns:
- The date on which this event occurs, or null if it does not occur between the start and end dates.
- See Also:
-
isOn
Return true if the given Date is on the same day as Easter -
isBetween
Return true if Easter occurs between the two dates given -
doFirstBetween
-
computeInYear
Compute the month and date on which this holiday falls in the year containing the date "date". First figure out which date Easter lands on in this year, and then add the offset for this holiday to get the right date.The algorithm here is taken from the Calendar FAQ.
-