Class SimpleHoliday
java.lang.Object
com.ibm.icu.util.Holiday
com.ibm.icu.util.SimpleHoliday
- All Implemented Interfaces:
DateRule
Note: The Holiday framework is a technology preview. Despite its age, is still draft API,
and clients should treat it as such.
A holiday whose date can be represented by a month, day, and optionally day of week in the Gregorian calendar.
- Status:
- Draft ICU 2.8 (retainAll).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SimpleHolidayAll Saints' Day, November 1ststatic final SimpleHolidayAll Souls' Day, November 1ststatic final SimpleHolidayAssumption, August 15thstatic final SimpleHolidayBoxing Day, December 26thstatic final SimpleHolidayChristmas, December 25thstatic final SimpleHolidayChristmas Eve, December 24thstatic final SimpleHolidayEpiphany, January 6thstatic final SimpleHolidayImmaculate Conception, December 8thstatic final SimpleHolidayMay Day, May 1ststatic final SimpleHolidayNew Year's Day - January 1ststatic final SimpleHolidayNew Year's Eve, December 31ststatic final SimpleHolidaySaint Stephen's Day, December 26th -
Constructor Summary
ConstructorsConstructorDescriptionSimpleHoliday(int month, int dayOfMonth, int dayOfWeek, String name) // TODO: remove Construct an object representing a holidaySimpleHoliday(int month, int dayOfMonth, int dayOfWeek, String name, int startYear) SimpleHoliday(int month, int dayOfMonth, int dayOfWeek, String name, int startYear, int endYear) SimpleHoliday(int month, int dayOfMonth, String name) Construct an object representing a holidaySimpleHoliday(int month, int dayOfMonth, String name, int startYear) Construct an object representing a holidaySimpleHoliday(int month, int dayOfMonth, String name, int startYear, int endYear) Construct an object representing a holiday -
Method Summary
Methods inherited from class Holiday
firstAfter, firstBetween, getDisplayName, getDisplayName, getDisplayName, getHolidays, getHolidays, getHolidays, getRule, isBetween, isOn, setRuleModifier and TypeMethodDescriptionfirstAfter(Date start) Return the first occurrence of this holiday on or after the given datefirstBetween(Date start, Date end) Return the first occurrence of this holiday that is on or after the given start date and before the given end date.Return the name of this holiday in the language of the defaultDISPLAYlocale.getDisplayName(ULocale locale) Return the name of this holiday in the language of the specified locale Thenameparameter 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.getDisplayName(Locale locale) Return the name of this holiday in the language of the specified locale.static Holiday[]static Holiday[]getHolidays(ULocale locale) static Holiday[]getHolidays(Locale locale) getRule()booleanCheck whether this holiday occurs at least once between the two dates given.booleanChecks whether this holiday falls on the given date.void
-
Field Details
-
NEW_YEARS_DAY
-
EPIPHANY
-
MAY_DAY
-
ASSUMPTION
-
ALL_SAINTS_DAY
All Saints' Day, November 1st- Status:
- Draft ICU 2.8.
-
ALL_SOULS_DAY
-
IMMACULATE_CONCEPTION
Immaculate Conception, December 8th- Status:
- Draft ICU 2.8.
-
CHRISTMAS_EVE
-
CHRISTMAS
-
BOXING_DAY
-
ST_STEPHENS_DAY
Saint Stephen's Day, December 26th- Status:
- Draft ICU 2.8.
-
NEW_YEARS_EVE
-
-
Constructor Details
-
SimpleHoliday
Construct an object representing a holiday- Parameters:
month- The month in which this holiday occurs (0-based)dayOfMonth- The date within the month (1-based).name- The name of this holiday. This string is used as a key to look up the holiday's name a resource bundle. If the name is not found in the resource bundle, getDisplayName will return this string instead.- See Also:
- Status:
- Draft ICU 2.8.
-
SimpleHoliday
Construct an object representing a holiday- Parameters:
month- The month in which this holiday occurs (0-based)dayOfMonth- The date within the month (1-based).name- The name of this holiday. This string is used as a key to look up the holiday's name a resource bundle. If the name is not found in the resource bundle, getDisplayName will return this string instead.- See Also:
- Status:
- Draft ICU 2.8.
-
SimpleHoliday
Construct an object representing a holiday- Parameters:
month- The month in which this holiday occurs (0-based)dayOfMonth- The date within the month (1-based).name- The name of this holiday. This string is used as a key to look up the holiday's name a resource bundle. If the name is not found in the resource bundle, getDisplayName will return this string instead.- See Also:
- Status:
- Draft ICU 2.8.
-
SimpleHoliday
// TODO: remove Construct an object representing a holiday- Parameters:
month- The month in which this holiday occurs (0-based)dayOfMonth- A date within the month (1-based). The interpretation of this parameter depends on the value ofdayOfWeek.dayOfWeek- The day of the week on which this holiday occurs. The following values are legal:- dayOfWeek == 0 - use dayOfMonth only
- dayOfWeek < 0 - use last -dayOfWeek before or on dayOfMonth
- dayOfWeek > 0 - use first dayOfWeek after or on dayOfMonth
name- The name of this holiday. This string is used as a key to look up the holiday's name a resource bundle. If the name is not found in the resource bundle, getDisplayName will return this string instead.- See Also:
- Status:
- Draft ICU 2.8.
-
SimpleHoliday
- Status:
- Draft ICU 2.8.
-
SimpleHoliday
public SimpleHoliday(int month, int dayOfMonth, int dayOfWeek, String name, int startYear, int endYear) - Status:
- Draft ICU 2.8.
-