public final class HolidayCalendars extends Object
The purpose of each holiday calendar is to define whether a date is a holiday or a business day.
The standard holiday calendar data is provided by direct research and is not derived
from a vendor of holiday calendar data. The implementation is defined by HolidayCalendar.ini
,
The data may or may not be sufficient for your production needs.
Applications should refer to holidays using HolidayCalendarId
.
The identifier must be resolved
to a HolidayCalendar
before holidays can be accessed.
Modifier and Type | Field and Description |
---|---|
static HolidayCalendar |
FRI_SAT
An instance declaring all days as business days except Friday/Saturday weekends.
|
static HolidayCalendar |
NO_HOLIDAYS
An instance declaring no holidays and no weekends.
|
static HolidayCalendar |
SAT_SUN
An instance declaring all days as business days except Saturday/Sunday weekends.
|
static HolidayCalendar |
THU_FRI
An instance declaring all days as business days except Thursday/Friday weekends.
|
Modifier and Type | Method and Description |
---|---|
static ReferenceData |
defaultingReferenceData(ReferenceData underlying)
Decorates a
ReferenceData instance such that all requests for
a HolidayCalendarId will return a value. |
static ExtendedEnum<HolidayCalendar> |
extendedEnum()
Gets the extended enum helper.
|
static HolidayCalendar |
of(String uniqueName)
Obtains an instance from the set of standard holiday calendars.
|
public static final HolidayCalendar NO_HOLIDAYS
This calendar has the effect of making every day a business day. It is often used to indicate that a holiday calendar does not apply.
public static final HolidayCalendar SAT_SUN
This calendar is mostly useful in testing scenarios. Note that not all countries use Saturday and Sunday weekends.
public static final HolidayCalendar FRI_SAT
This calendar is mostly useful in testing scenarios.
public static final HolidayCalendar THU_FRI
This calendar is mostly useful in testing scenarios.
public static ReferenceData defaultingReferenceData(ReferenceData underlying)
ReferenceData
instance such that all requests for
a HolidayCalendarId
will return a value.
If the HolidayCalendarId
is not found in the underlying reference data,
an instance with Saturday/Sunday holidays will be returned.
underlying
- the underlying instancepublic static HolidayCalendar of(String uniqueName)
The unique name identifies the calendar in the standard source of calendars.
The standard source is loaded at startup based on the HolidayCalendar.ini
file.
Applications should generally avoid using this method.
Instead, applications should refer to holidays using HolidayCalendarId
,
resolving them using a ReferenceData
.
It is possible to combine two or more calendars using the '+' symbol. For example, 'GBLO+USNY' will combine the separate 'GBLO' and 'USNY' calendars.
uniqueName
- the unique name of the calendarpublic static ExtendedEnum<HolidayCalendar> extendedEnum()
This helper allows instances of the calendar to be looked up. It also provides the complete set of available instances.
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.