Module org.holiday.calendar.western
Class ChristmasEveEarlyClose
java.lang.Object
org.holiday.calendar.observance.AbstractObservance
org.holiday.calendar.observance.us.ChristmasEveEarlyClose
Observance of the NYSE's Christmas Eve half-day close (December 24). Unlike
a weekend-shifting observance, this early close does not occur at all in
years where December 25 falls on a Monday, Saturday, or Sunday — it is
suppressed for that year rather than moved to an adjacent date. This is why
isValidYear(int) is overridden here to signal absence, rather than
computeDate(int) shifting to a different day as
org.holiday.calendar.observance.uk.ChristmasEveEarlyClose does.
Verified against NYSE Group's official Holiday and Early Closings Calendar press releases (ir.theice.com): December 24 is an early close only when December 25 falls Tuesday through Friday.
- Author:
- Dave Joyce
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected LocalDatecomputeDate(int year) Compute the date for this observance in the given year.protected booleanisValidYear(int year) Determine whether this observance applies in the given year.Methods inherited from class org.holiday.calendar.observance.AbstractObservance
apply, test
-
Constructor Details
-
ChristmasEveEarlyClose
public ChristmasEveEarlyClose()
-
-
Method Details
-
computeDate
Description copied from class:AbstractObservanceCompute the date for this observance in the given year. Only called whenAbstractObservance.isValidYear(int)returnstrue.- Specified by:
computeDatein classAbstractObservance- Parameters:
year- the year for which to compute the date- Returns:
- computed holiday date
-
isValidYear
protected boolean isValidYear(int year) Description copied from class:AbstractObservanceDetermine whether this observance applies in the given year. Defaults totrue(all years are valid).- Overrides:
isValidYearin classAbstractObservance- Parameters:
year- the year to test- Returns:
trueif this observance applies
-