Top Fields Constructors Methods
com.ibm.icu.util

pack-priv Class EasterRule

Located in compilation unit of com.ibm.icu.util.EasterHoliday.

extends Object
implements DateRule
Class Inheritance
All Implemented Interfaces
com.ibm.icu.util.DateRule

Field Summary

Modifier and TypeField and Description
private GregorianCalendar
private int

Constructor Summary

AccessConstructor and Description
public
EasterRule(int daysAfterEaster, boolean isOrthodox)

Method Summary

Modifier and TypeMethod and Description
private 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)

public Date
firstAfter(Date
Only occurrances on or after this date are returned.
start
)

Implements com.ibm.icu.util.DateRule.firstAfter.

Return the first occurrence of this rule on or after the given date
public Date
firstBetween(Date
Only occurrances on or after this date are returned.
start
,
Date
Only occurrances before this date are returned.
end
)

Implements com.ibm.icu.util.DateRule.firstBetween.

Return the first occurrence of this rule on or after the given start date and before the given end date.
public boolean
isBetween(Date start, Date end)

Implements com.ibm.icu.util.DateRule.isBetween.

Return true if Easter occurs between the two dates given
public boolean
isOn(Date
The date to check.
date
)

Implements com.ibm.icu.util.DateRule.isOn.

Return true if the given Date is on the same day as Easter
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

calendarback to summary
private GregorianCalendar calendar
daysAfterEasterback to summary
private int daysAfterEaster

Constructor Detail

EasterRuleback to summary
public EasterRule(int daysAfterEaster, boolean isOrthodox)

Method Detail

computeInYearback to summary
private Date computeInYear(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.

doFirstBetweenback to summary
private Date doFirstBetween(Date start, Date end)
firstAfterback to summary
public Date firstAfter(Date start)

Implements com.ibm.icu.util.DateRule.firstAfter.

Return the first occurrence of this rule on or after the given date

Parameters
start:Date

Doc from com.ibm.icu.util.DateRule.firstAfter.

Only occurrances on or after this date are returned.

Returns:Date

Doc from com.ibm.icu.util.DateRule.firstAfter.

The date on which this event occurs, or null if it does not occur on or after the start date.

Annotations
@Override
firstBetweenback to summary
public Date firstBetween(Date start, Date end)

Implements com.ibm.icu.util.DateRule.firstBetween.

Return the first occurrence of this rule on or after the given start date and before the given end date.

Parameters
start:Date

Doc from com.ibm.icu.util.DateRule.firstBetween.

Only occurrances on or after this date are returned.

end:Date

Doc from com.ibm.icu.util.DateRule.firstBetween.

Only occurrances before this date are returned.

Returns:Date

Doc from com.ibm.icu.util.DateRule.firstBetween.

The date on which this event occurs, or null if it does not occur between the start and end dates.

Annotations
@Override
isBetweenback to summary
public boolean isBetween(Date start, Date end)

Implements com.ibm.icu.util.DateRule.isBetween.

Return true if Easter occurs between the two dates given

Annotations
@Override
isOnback to summary
public boolean isOn(Date date)

Implements com.ibm.icu.util.DateRule.isOn.

Return true if the given Date is on the same day as Easter

Parameters
date:Date

Doc from com.ibm.icu.util.DateRule.isOn.

The date to check.

Returns:boolean

Doc from com.ibm.icu.util.DateRule.isOn.

true if this event occurs on the given date.

Annotations
@Override