|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.icu.util.Holiday
An abstract class representing a holiday. This class simply adds a holiday name to the DateRule interface for calculating the date of an event.
Constructor Summary | |
protected |
Holiday(java.lang.String name,
DateRule rule)
Construct a new Holiday object. |
Method Summary | |
java.util.Date |
firstAfter(java.util.Date start)
Return the first occurrance of this holiday on or after the given date |
java.util.Date |
firstBetween(java.util.Date start,
java.util.Date end)
Return the first occurrance of this holiday that is on or after the given start date and before the given end date. |
java.lang.String |
getDisplayName()
Return the name of this holiday in the language of the default locale |
java.lang.String |
getDisplayName(java.util.Locale locale)
Return the name of this holiday in the language of the specified locale The name parameter passed to this object's constructor is used
as a key to look up the holiday's localized name in a ResourceBundle object
named HolidayBundle. |
static Holiday[] |
getHolidays()
|
static Holiday[] |
getHolidays(java.util.Locale locale)
|
DateRule |
getRule()
|
boolean |
isBetween(java.util.Date start,
java.util.Date end)
Check whether this holiday occurs at least once between the two dates given. |
boolean |
isOn(java.util.Date date)
Checks whether this holiday falls on the given date. |
void |
setRule(DateRule rule)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected Holiday(java.lang.String name, DateRule rule)
name
- The name of this holiday. The getDisplayName method
uses this string as a key to look up the holiday's name a
resource bundle object named HolidayBundle.rule
- The date rules used for determining when this holiday
falls. Holiday's implementation of the DateRule inteface
simply delegates to this DateRule object.Method Detail |
public static Holiday[] getHolidays()
public static Holiday[] getHolidays(java.util.Locale locale)
public java.util.Date firstAfter(java.util.Date start)
firstAfter
in interface DateRule
start
- Only holidays on or after this date are returned.firstBetween(java.util.Date, java.util.Date)
public java.util.Date firstBetween(java.util.Date start, java.util.Date end)
firstBetween
in interface DateRule
start
- Only occurrances on or after this date are returned.end
- Only occurrances before this date are returned.firstAfter(java.util.Date)
public boolean isOn(java.util.Date date)
isOn
in interface DateRule
date
- The date to check.public boolean isBetween(java.util.Date start, java.util.Date end)
isBetween
in interface DateRule
public java.lang.String getDisplayName()
public java.lang.String getDisplayName(java.util.Locale locale)
name
parameter passed to this object's constructor is used
as a key to look up the holiday's localized name in a ResourceBundle object
named HolidayBundle.loc
- A locale specifying the language in which the name is desired.ResourceBundle
public DateRule getRule()
public void setRule(DateRule rule)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |