Note
The Holiday framework is a technology preview. Despite its age, is still draft API, and clients should treat it as such. An abstract class representing a holiday.
| Modifier and Type | Field and Description |
|---|---|
| private String | |
| private static Holiday[] | |
| private DateRule |
| Access | Constructor and Description |
|---|---|
| protected | Holiday(String
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. name, DateRule The date rules used for determining when this holiday
falls. Holiday's implementation of the DateRule interface
simply delegates to this DateRule object. rule)Construct a new Holiday object. |
| Modifier and Type | Method and Description |
|---|---|
| public Date | Returns: The date on which this holiday occurs, or null if it does not occur on or after the start date.Only holidays on or after this date are returned. start)Implements com. |
| public Date | Returns: The date on which this event occurs, or null if it does not occur between the start and end dates.Only occurrences on or after this date are returned. start, Date Only occurrences before this date are returned. end)Implements com. |
| public String | |
| public String | getDisplayName(Locale
A locale specifying the language in which the name is desired. locale)Return the name of this holiday in the language of the specified locale. |
| public String | getDisplayName(ULocale
A locale specifying the language in which the name is desired. locale)Return the name of this holiday in the language of the specified locale
The |
| public static Holiday[] | |
| public static Holiday[] | |
| public static Holiday[] | |
| public DateRule | |
| public boolean | isBetween(Date start, Date end)
Implements com. |
| public boolean | Returns: true if this holiday occurs on the given date.The date to check. date)Implements com. |
| public void |
| name | back to summary |
|---|---|
| private String name | |
| noHolidays | back to summary |
|---|---|
| private static Holiday[] noHolidays | |
| rule | back to summary |
|---|---|
| private DateRule rule | |
| Holiday | back to summary |
|---|---|
| protected Holiday(String name, DateRule rule) Construct a new Holiday object. This is for use by subclasses only. This constructs a new holiday with the given name and date rules.
| |
| firstAfter | back to summary |
|---|---|
| public Date firstAfter(Date start) Implements com. Return the first occurrence of this holiday on or after the given date
| |
| firstBetween | back to summary |
|---|---|
| public Date firstBetween(Date start, Date end) Implements com. Return the first occurrence of this holiday that is on or after the given start date and before the given end date.
| |
| getDisplayName | back to summary |
|---|---|
| public String getDisplayName() Return the name of this holiday in the language of the default
| |
| getDisplayName | back to summary |
|---|---|
| public String getDisplayName(Locale locale) Return the name of this holiday in the language of the specified locale.
The
| |
| getDisplayName | back to summary |
|---|---|
| public String getDisplayName(ULocale locale) Return the name of this holiday in the language of the specified locale
The
| |
| getHolidays | back to summary |
|---|---|
public static Holiday[] getHolidays()
| |
| getHolidays | back to summary |
|---|---|
public static Holiday[] getHolidays(Locale locale)
| |
| getHolidays | back to summary |
|---|---|
public static Holiday[] getHolidays(ULocale locale)
| |
| getRule | back to summary |
|---|---|
public DateRule getRule()
| |
| isBetween | back to summary |
|---|---|
| public boolean isBetween(Date start, Date end) Implements com. Check whether this holiday occurs at least once between the two dates given. | |
| isOn | back to summary |
|---|---|
| public boolean isOn(Date date) Implements com. Checks whether this holiday falls on the given date. This does not take time of day into account; instead it checks whether the holiday and the given date are on the same day. | |
| setRule | back to summary |
|---|---|
public void setRule(DateRule rule)
| |