this.excludeUsFederalHolidays = excludeUsFederalHolidays;
}
public HolidayCalendar getHolidayCalendar ()
{
HolidayCalendar holidays;
if (excludeWeekends) {
WeeklyCalendar wCal = new WeeklyCalendar ();
holidays = new HolidayCalendar (wCal);
} else {
holidays = new HolidayCalendar ();
}
for (Date d : additionalHolidays) {
holidays.addExcludedDate( d );
}
// US Federal Holiday based on http://www.opm.gov/fedhol/
if (excludeUsFederalHolidays) {
java.util.Calendar hCal = java.util.Calendar.getInstance();
// Year 2007
hCal.set(2007, java.util.Calendar.JANUARY, 1); // New Year
holidays.addExcludedDate(hCal.getTime());
hCal.set(2007, java.util.Calendar.JANUARY, 15); // MLK
holidays.addExcludedDate(hCal.getTime());
hCal.set(2007, java.util.Calendar.FEBRUARY, 19); // Washington
holidays.addExcludedDate(hCal.getTime());
hCal.set(2007, java.util.Calendar.MAY, 28); // Memorial
holidays.addExcludedDate(hCal.getTime());
hCal.set(2007, java.util.Calendar.JULY, 4); // Independence
holidays.addExcludedDate(hCal.getTime());
hCal.set(2007, java.util.Calendar.SEPTEMBER, 3); // Labor
holidays.addExcludedDate(hCal.getTime());
hCal.set(2007, java.util.Calendar.OCTOBER, 8); // Columbus
holidays.addExcludedDate(hCal.getTime());
hCal.set(2007, java.util.Calendar.NOVEMBER, 12); // Veterans
holidays.addExcludedDate(hCal.getTime());
hCal.set(2007, java.util.Calendar.NOVEMBER, 22); // Thanksgiving
holidays.addExcludedDate(hCal.getTime());
hCal.set(2007, java.util.Calendar.DECEMBER, 25); // Christmas
holidays.addExcludedDate(hCal.getTime());
// Year 2008
hCal.set(2008, java.util.Calendar.JANUARY, 1); // New Year
holidays.addExcludedDate(hCal.getTime());
hCal.set(2008, java.util.Calendar.JANUARY, 21); // MLK
holidays.addExcludedDate(hCal.getTime());
hCal.set(2008, java.util.Calendar.FEBRUARY, 18); // Washington
holidays.addExcludedDate(hCal.getTime());
hCal.set(2008, java.util.Calendar.MAY, 26); // Memorial
holidays.addExcludedDate(hCal.getTime());
hCal.set(2008, java.util.Calendar.JULY, 4); // Independence
holidays.addExcludedDate(hCal.getTime());
hCal.set(2008, java.util.Calendar.SEPTEMBER, 1); // Labor
holidays.addExcludedDate(hCal.getTime());
hCal.set(2008, java.util.Calendar.OCTOBER, 13); // Columbus
holidays.addExcludedDate(hCal.getTime());
hCal.set(2008, java.util.Calendar.NOVEMBER, 11); // Veterans
holidays.addExcludedDate(hCal.getTime());
hCal.set(2008, java.util.Calendar.NOVEMBER, 27); // Thanksgiving
holidays.addExcludedDate(hCal.getTime());
hCal.set(2008, java.util.Calendar.DECEMBER, 25); // Christmas
holidays.addExcludedDate(hCal.getTime());
// Year 2009
hCal.set(2009, java.util.Calendar.JANUARY, 1); // New Year
holidays.addExcludedDate(hCal.getTime());
hCal.set(2009, java.util.Calendar.JANUARY, 19); // MLK
holidays.addExcludedDate(hCal.getTime());
hCal.set(2009, java.util.Calendar.FEBRUARY, 16); // Washington
holidays.addExcludedDate(hCal.getTime());
hCal.set(2009, java.util.Calendar.MAY, 25); // Memorial
holidays.addExcludedDate(hCal.getTime());
hCal.set(2009, java.util.Calendar.JULY, 3); // Independence
holidays.addExcludedDate(hCal.getTime());
hCal.set(2009, java.util.Calendar.SEPTEMBER, 7); // Labor
holidays.addExcludedDate(hCal.getTime());
hCal.set(2009, java.util.Calendar.OCTOBER, 12); // Columbus
holidays.addExcludedDate(hCal.getTime());
hCal.set(2009, java.util.Calendar.NOVEMBER, 11); // Veterans
holidays.addExcludedDate(hCal.getTime());
hCal.set(2009, java.util.Calendar.NOVEMBER, 26); // Thanksgiving
holidays.addExcludedDate(hCal.getTime());
hCal.set(2009, java.util.Calendar.DECEMBER, 25); // Christmas
holidays.addExcludedDate(hCal.getTime());
// Year 2010
hCal.set(2010, java.util.Calendar.JANUARY, 1); // New Year
holidays.addExcludedDate(hCal.getTime());
hCal.set(2010, java.util.Calendar.JANUARY, 18); // MLK
holidays.addExcludedDate(hCal.getTime());
hCal.set(2010, java.util.Calendar.FEBRUARY, 15); // Washington
holidays.addExcludedDate(hCal.getTime());
hCal.set(2010, java.util.Calendar.MAY, 31); // Memorial
holidays.addExcludedDate(hCal.getTime());
hCal.set(2010, java.util.Calendar.JULY, 5); // Independence
holidays.addExcludedDate(hCal.getTime());
hCal.set(2010, java.util.Calendar.SEPTEMBER, 6); // Labor
holidays.addExcludedDate(hCal.getTime());
hCal.set(2010, java.util.Calendar.OCTOBER, 11); // Columbus
holidays.addExcludedDate(hCal.getTime());
hCal.set(2010, java.util.Calendar.NOVEMBER, 11); // Veterans
holidays.addExcludedDate(hCal.getTime());
hCal.set(2010, java.util.Calendar.NOVEMBER, 25); // Thanksgiving
holidays.addExcludedDate(hCal.getTime());
hCal.set(2010, java.util.Calendar.DECEMBER, 24); // Christmas
holidays.addExcludedDate(hCal.getTime());
}
return holidays;
}