com.mindprod.holidays
Class BlackFriday

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

public final class BlackFriday
extends HolInfo

Calculate when American Black Friday occurs.

Since:
2009-11-23
Version:
1.0 2009-11-23 initial version
Author:
Roedy Green, Canadian Mind Products

Field Summary
 
Fields inherited from class com.mindprod.holidays.HolInfo
ACTUAL, DEBUGGING, OBSERVED, PROCLAIMED, SHIFTED
 
Constructor Summary
BlackFriday()
           
 
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.
 int when(int year, boolean shift, int base)
          When was this holiday in a given year?
 
Methods inherited from class com.mindprod.holidays.HolInfo
isYearValid, shiftSatToFriSunToMon, when, when
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlackFriday

public BlackFriday()
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)
Description copied from class: HolInfo
When was this holiday in a given year?

Specified by:
when in class HolInfo
Parameters:
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
Returns:
ordinal days since 1970-01-01. return NULL_ORDINAL if the holiday was not celebrated in that year.