Package org.holiday.calendar


package org.holiday.calendar
Base classes and interfaces of the Holiday Calendar API.

Holiday is a sealed interface describing a single holiday's identity and date-calculation method, with four permitted subtypes: FixedHoliday (same MonthDay every year), FloatingHoliday (date computed via an Observance), SpecialAnniversary (anniversary of a fixed date), and EarlyCloseHoliday (a non-rollable partial trading day, carrying a local close time and zone). HolidayCalendar is a named, immutable collection of holidays, plus a DateRoll weekend-adjustment strategy, that calculates the observed HolidayDates for a given year.

HolidayCalendarService is the extension point implemented by each regional module and discovered at runtime by HolidayCalendarFactory via ServiceLoader:


 HolidayCalendarFactory factory = new HolidayCalendarFactory();
 HolidayCalendar calendar = factory.create("XNYS");

 List<HolidayDate> fullClosures = calendar.calculate(2026);
 if (calendar.hasEarlyCloses()) {
     List<HolidayDate> earlyCloses = calendar.calculateEarlyCloses(2026);
 }
 
Author:
Dave Joyce