Package com.ibm.icu.util
Class EasterRule
- java.lang.Object
-
- com.ibm.icu.util.EasterRule
-
-
Field Summary
Fields Modifier and Type Field Description private GregorianCalendar
calendar
private int
daysAfterEaster
-
Constructor Summary
Constructors Constructor Description EasterRule(int daysAfterEaster, boolean isOrthodox)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.util.Date
computeInYear(java.util.Date date, GregorianCalendar cal)
Compute the month and date on which this holiday falls in the year containing the date "date".private java.util.Date
doFirstBetween(java.util.Date start, java.util.Date end)
java.util.Date
firstAfter(java.util.Date start)
Return the first occurrence of this rule on or after the given datejava.util.Date
firstBetween(java.util.Date start, java.util.Date end)
Return the first occurrence of this rule on or after the given start date and before the given end date.boolean
isBetween(java.util.Date start, java.util.Date end)
Return true if Easter occurs between the two dates givenboolean
isOn(java.util.Date date)
Return true if the given Date is on the same day as Easter
-
-
-
Field Detail
-
daysAfterEaster
private int daysAfterEaster
-
calendar
private GregorianCalendar calendar
-
-
Method Detail
-
firstAfter
public java.util.Date firstAfter(java.util.Date start)
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:
DateRule.firstBetween(java.util.Date, java.util.Date)
-
firstBetween
public java.util.Date firstBetween(java.util.Date start, java.util.Date end)
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:
DateRule.firstAfter(java.util.Date)
-
isOn
public boolean isOn(java.util.Date date)
Return true if the given Date is on the same day as Easter
-
isBetween
public boolean isBetween(java.util.Date start, java.util.Date end)
Return true if Easter occurs between the two dates given
-
doFirstBetween
private java.util.Date doFirstBetween(java.util.Date start, java.util.Date end)
-
computeInYear
private java.util.Date computeInYear(java.util.Date date, GregorianCalendar cal)
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.
-
-