|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mindprod.holidays.HolInfo
public abstract class HolInfo
Information about a single holiday. base class for various holiday calculators.
See class com.mindprod.holidays.Christmas for sample implementation of HolInfo. For rules about how various holidays are computed see: http://www.mnsinc.com/utopia/Calendar/Holiday_Dates/Holiday_Determinations.html To get a list of US Federal Statutory holidays see: http://www.opm.gov/fedhol/1999.htm or http://aa.usno.navy.mil/AA/faq/docs/holidays.html. To get a list of US Federal Observances (not holidays) see: http://www4.law.cornell.edu/uscode/unframed/36/ch9.html http://www.askjeeves.com/ was very helpful in tracking down information about the various holidays. For a list of Canadian Bank holidays see: http://infoservice.gc.ca/canadiana/bochol-99_e.html For a list of Canadian provincial holidays see: http://www.pch.gc.ca/ceremonial-symb/english/day_prv.html For a list of Canadian Federal Holidays see: http://www.pch.gc.ca/ceremonial-symb/english/day.html Calendrical Calculations by Dershowitz and Reingold handles Chinese New Year. http://emr.cs.uiuc.edu/home/reingold/calendar-book/index.shtml For astronomical calculations see: http://www.ccs.neu.edu/home/ramsdell/jdk1.1/lunisolar/lunisolar.html For C Calendar code see: http://www.magnet.ch/serendipity/hermetic/index.html For a large collection of calendar code see: http://www.hiline.net/users/rms/ section 4.2 Cool Stuff in SCDTL For various calendar links see: http://www.calendarzone.com/ For various calendar links see: http://dir.yahoo.com/Reference/Calendars/ For a global list of holidays see: http://holidayfestival.com/
Field Summary | |
---|---|
static boolean |
ACTUAL
base calculations on the actual date the holiday is observed. |
static boolean |
DEBUGGING
true if debugging. |
static int |
OBSERVED
base calculations on date holiday was first celebrated. |
static int |
PROCLAIMED
base calculations on date holiday was first officially proclaimed. |
static boolean |
SHIFTED
base calculations on the nearest weekday to the holiday. |
Constructor Summary | |
---|---|
HolInfo()
|
Method Summary | |
---|---|
abstract java.lang.String |
getAuthority()
authority who provided the information about the holiday. |
abstract int |
getFirstYear(int base)
Get year holiday first proclaimed or first celebrated. |
abstract java.lang.String |
getName()
Get name of holiday e.g. |
abstract java.lang.String |
getRule()
Get rule in English for how the holiday is calculated. |
protected boolean |
isYearValid(int year,
int base)
Is year valid for this holiday? |
(package private) static int |
shiftSatToFriSunToMon(int ordinal,
boolean shift)
convert Saturdays to preceding Friday, Sundays to following Monday. |
int |
when(int year)
When was this holiday in a given year?, based on PROCLAIMED date. |
int |
when(int year,
boolean shift)
When was this holiday in a given year?, based on PROCLAIMED date. |
abstract int |
when(int year,
boolean shift,
int base)
When was this holiday in a given year? |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final boolean ACTUAL
public static final boolean DEBUGGING
public static final boolean SHIFTED
public static final int OBSERVED
public static final int PROCLAIMED
Constructor Detail |
---|
public HolInfo()
Method Detail |
---|
public abstract java.lang.String getAuthority()
public abstract int getFirstYear(int base)
base
- PROCLAIMED=based on date holiday was officially proclaimed. CELEBRATED=based on date holiday was
first celebrated.
public abstract java.lang.String getName()
public abstract java.lang.String getRule()
public final int when(int year)
year
- must be 1583 or later.
public final int when(int year, boolean shift)
year
- must be 1583 or later.shift
- ACTUAL = false if you want the actual date of the holiday. SHIFTED = true if you want the date taken
off work, usually the nearest weekday.
public abstract int when(int year, boolean shift, int base)
year
- (-ve means BC, +ve means AD, 0 not permitted.)shift
- ACTUAL = false if you want the actual date of the holiday. SHIFTED = true if you want the date taken
off work, usually the nearest weekday.base
- PROCLAIMED=based on date holiday was officially proclaimed CELEBRATED=based on date holiday was
first celebrated
static int shiftSatToFriSunToMon(int ordinal, boolean shift)
ordinal
- days since 1970-01-01.shift
- ACTUAL = false if you want the actual date of the holiday. SHIFTED = true if you want the date
taken off work, usually the nearest weekday.
protected final boolean isYearValid(int year, int base)
year
- The year you want to test.base
- PROCLAIMED=based on date holiday was officially proclaimed . CELEBRATED=based on date holiday was
first celebrated.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |