public final class IsHoliday
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) static boolean |
DEBUGGING
true if debugging
|
protected int |
firstOrd
ordinal of Jan 1 of first year to compute holidays.
|
protected int |
firstYear
First year in range to compute holidays.
|
protected java.util.BitSet |
holidayBits
corresponding bit is true means day is a holiday.
|
protected int |
lastOrd
ordinal of Dec 31 of last year to compute holidays.
|
protected int |
lastYear
Last year in range to compute holidays.
|
Constructor and Description |
---|
IsHoliday(int firstYear,
int lastYear)
Constructor to define range of years over which we wish to compute holidays.
|
Modifier and Type | Method and Description |
---|---|
void |
addAmericanFederalHolidays(boolean shift)
add all American Federal holidays 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.
|
void |
addCanadianFederalHolidays(boolean shift)
add all Canadian Federal holidays 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.
|
void |
addHoliday(int ordinal)
add another holiday to the holiday table.
|
void |
addWeekendsAsHolidays()
add all Saturdays and Sundays in the year range as holidays
|
int |
getFirstYear()
get first year in range to compute the holidays.
|
int |
getLastYear()
Get last year in range to compute holidays.
|
boolean |
isHoliday(com.mindprod.common11.BigDate bigDate)
Is the given day a holiday? What constitutes a holiday is determined by the setHoliday calls
|
boolean |
isHoliday(int ordinal)
Is the given day a holiday? What constitutes a holiday is determined by the setHoliday calls
|
static void |
main(java.lang.String[] args)
test driver
|
static final boolean DEBUGGING
protected int firstOrd
protected int firstYear
protected int lastOrd
protected int lastYear
protected java.util.BitSet holidayBits
public IsHoliday(int firstYear, int lastYear)
firstYear
- first year to cover, must be > 0lastYear
- last year to coverpublic void addAmericanFederalHolidays(boolean shift)
shift
- 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 void addCanadianFederalHolidays(boolean shift)
shift
- 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 void addHoliday(int ordinal)
ordinal
- day to add as a holiday measured in days since 1970-01-01. Note you must add it once for each
year in the range. We do not presume it falls the same day each year.public void addWeekendsAsHolidays()
public int getFirstYear()
public int getLastYear()
public boolean isHoliday(com.mindprod.common11.BigDate bigDate)
bigDate
- date to testpublic boolean isHoliday(int ordinal)
ordinal
- days since 1970-01-01public static void main(java.lang.String[] args)
args
- not used