com.ibm.icu.util
Class Holiday

java.lang.Object
  extended by com.ibm.icu.util.Holiday
All Implemented Interfaces:
DateRule
Direct Known Subclasses:
EasterHoliday, HebrewHoliday, SimpleHoliday

Deprecated. This is a draft API and might change in a future release of ICU.

public abstract class Holiday
extends Object
implements DateRule

An abstract class representing a holiday.


Constructor Summary
protected Holiday(String name, DateRule rule)
          Deprecated. This is a draft API and might change in a future release of ICU.
 
Method Summary
 Date firstAfter(Date start)
          Deprecated. This is a draft API and might change in a future release of ICU.
 Date firstBetween(Date start, Date end)
          Deprecated. This is a draft API and might change in a future release of ICU.
 String getDisplayName()
          Deprecated. This is a draft API and might change in a future release of ICU.
 String getDisplayName(Locale locale)
          Deprecated. This is a draft API and might change in a future release of ICU.
 String getDisplayName(ULocale locale)
          Deprecated. This is a draft API and might change in a future release of ICU.
static Holiday[] getHolidays()
          Deprecated. This is a draft API and might change in a future release of ICU.
static Holiday[] getHolidays(Locale locale)
          Deprecated. This is a draft API and might change in a future release of ICU.
static Holiday[] getHolidays(ULocale locale)
          Deprecated. This is a draft API and might change in a future release of ICU.
 DateRule getRule()
          Deprecated. This is a draft API and might change in a future release of ICU.
 boolean isBetween(Date start, Date end)
          Deprecated. This is a draft API and might change in a future release of ICU.
 boolean isOn(Date date)
          Deprecated. This is a draft API and might change in a future release of ICU.
 void setRule(DateRule rule)
          Deprecated. This is a draft API and might change in a future release of ICU.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Holiday

protected Holiday(String name,
                  DateRule rule)
Deprecated. This is a draft API and might change in a future release of ICU.

Construct a new Holiday object. This is for use by subclasses only. This constructs a new holiday with the given name and date rules.

Parameters:
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

getHolidays

public static Holiday[] getHolidays()
Deprecated. This is a draft API and might change in a future release of ICU.


getHolidays

public static Holiday[] getHolidays(Locale locale)
Deprecated. This is a draft API and might change in a future release of ICU.


getHolidays

public static Holiday[] getHolidays(ULocale locale)
Deprecated. This is a draft API and might change in a future release of ICU.


firstAfter

public Date firstAfter(Date start)
Deprecated. This is a draft API and might change in a future release of ICU.

Return the first occurrance of this holiday on or after the given date

Specified by:
firstAfter in interface DateRule
Parameters:
start - Only holidays on or after this date are returned.
Returns:
The date on which this holiday occurs, or null if it does not occur on or after the start date.
See Also:
firstBetween(java.util.Date, java.util.Date)

firstBetween

public Date firstBetween(Date start,
                         Date end)
Deprecated. This is a draft API and might change in a future release of ICU.

Return the first occurrance of this holiday that is on or after the given start date and before the given end date.

Specified by:
firstBetween in interface DateRule
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:
firstAfter(java.util.Date)

isOn

public boolean isOn(Date date)
Deprecated. This is a draft API and might change in a future release of ICU.

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.

Specified by:
isOn in interface DateRule
Parameters:
date - The date to check.
Returns:
true if this holiday occurs on the given date.

isBetween

public boolean isBetween(Date start,
                         Date end)
Deprecated. This is a draft API and might change in a future release of ICU.

Check whether this holiday occurs at least once between the two dates given.

Specified by:
isBetween in interface DateRule

getDisplayName

public String getDisplayName()
Deprecated. This is a draft API and might change in a future release of ICU.

Return the name of this holiday in the language of the default locale


getDisplayName

public String getDisplayName(Locale locale)
Deprecated. This is a draft API and might change in a future release of ICU.

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.

Parameters:
locale - A locale specifying the language in which the name is desired.
See Also:
ResourceBundle

getDisplayName

public String getDisplayName(ULocale locale)
Deprecated. This is a draft API and might change in a future release of ICU.

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.

Parameters:
locale - A locale specifying the language in which the name is desired.
See Also:
ResourceBundle

getRule

public DateRule getRule()
Deprecated. This is a draft API and might change in a future release of ICU.


setRule

public void setRule(DateRule rule)
Deprecated. This is a draft API and might change in a future release of ICU.



Copyright (c) 2004 IBM Corporation and others.