com.mindprod.holidays
Class ChristmasUSA

java.lang.Object
  extended by com.mindprod.holidays.HolInfo
      extended by com.mindprod.holidays.ChristmasUSA

public final class ChristmasUSA
extends HolInfo

calculate when Christmas day occurs in the USA.

Since:
1999
Version:
4.2 2008-12-03 add World AIDS day
Author:
Roedy Green, Canadian Mind Products

Field Summary
 
Fields inherited from class com.mindprod.holidays.HolInfo
ACTUAL, DEBUGGING, OBSERVED, PROCLAIMED, SHIFTED
 
Constructor Summary
ChristmasUSA()
           
 
Method Summary
 java.lang.String getAuthority()
          authority who provided the information about the holiday.
 int getFirstYear(int base)
          Get year holiday first proclaimed or first celebrated.
 java.lang.String getName()
          Get name of holiday e.g.
 java.lang.String getRule()
          Get rule in English for how the holiday is calculated.
static void main(java.lang.String[] args)
          Test driver
 int when(int year, boolean shift, int base)
          Nominally, Christmas is on the 25 in the USA.
 
Methods inherited from class com.mindprod.holidays.HolInfo
isYearValid, when, when
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChristmasUSA

public ChristmasUSA()
Method Detail

getAuthority

public java.lang.String getAuthority()
Description copied from class: HolInfo
authority who provided the information about the holiday.

Specified by:
getAuthority in class HolInfo
Returns:
name of person, email address, website etc. that describes the rules about the holiday. "" if no one in particular.

getFirstYear

public int getFirstYear(int base)
Description copied from class: HolInfo
Get year holiday first proclaimed or first celebrated.

Specified by:
getFirstYear in class HolInfo
Parameters:
base - PROCLAIMED=based on date holiday was officially proclaimed. CELEBRATED=based on date holiday was first celebrated.
Returns:
year first proclaimed, or first celebrated.

getName

public java.lang.String getName()
Description copied from class: HolInfo
Get name of holiday e.g. "Christmas"

Specified by:
getName in class HolInfo
Returns:
English language name of the holiday.

getRule

public java.lang.String getRule()
Description copied from class: HolInfo
Get rule in English for how the holiday is calculated. e.g. "Always on Dec 25." or "Third Monday in March." may contain embedded \n characters.

Specified by:
getRule in class HolInfo
Returns:
rule for how holiday is computed.

when

public int when(int year,
                boolean shift,
                int base)
Nominally, Christmas is on the 25 in the USA. They are always celebrated on the 25 no matter what day of the week it falls on. However, if it falls on a Saturday or Sunday, you get a day off work on Friday or Monday to compensate.

Specified by:
when in class HolInfo
Parameters:
year - (-ve means BC, +ve means AD, 0 not permitted.)
shift - true if want date of holiday shifted to nearest weekday.
base - PROCLAIMED=based on date holiday was officially proclaimed CELEBRATED=based on date holiday was first celebrated
Returns:
ordinal days since 1970-01-01. return NULL_ORDINAL if the holiday was not celebrated in that year.

main

public static void main(java.lang.String[] args)
Test driver

Parameters:
args - not used