Class JulyThirdEarlyClose

java.lang.Object
org.holiday.calendar.observance.AbstractObservance
org.holiday.calendar.observance.us.JulyThirdEarlyClose
All Implemented Interfaces:
Function<Integer,LocalDate>, Predicate<Integer>, Observance

public class JulyThirdEarlyClose extends AbstractObservance
Observance of the NYSE's July 3rd half-day close, ahead of Independence Day. This early close does not occur at all in years where July 4 falls on a Monday, Saturday, or Sunday — it is suppressed for that year rather than moved to an adjacent date. Note in particular that a Monday July 4 also suppresses this early close (July 3 would be a Sunday, not a trading day), not just Saturday/Sunday.

Verified against NYSE Group's official Holiday and Early Closings Calendar press releases (ir.theice.com): July 3 is an early close only when July 4 falls Tuesday through Friday.

Author:
Dave Joyce
  • Constructor Details

    • JulyThirdEarlyClose

      public JulyThirdEarlyClose()
  • Method Details

    • computeDate

      protected LocalDate computeDate(int year)
      Description copied from class: AbstractObservance
      Compute the date for this observance in the given year. Only called when AbstractObservance.isValidYear(int) returns true.
      Specified by:
      computeDate in class AbstractObservance
      Parameters:
      year - the year for which to compute the date
      Returns:
      computed holiday date
    • isValidYear

      protected boolean isValidYear(int year)
      Description copied from class: AbstractObservance
      Determine whether this observance applies in the given year. Defaults to true (all years are valid).
      Overrides:
      isValidYear in class AbstractObservance
      Parameters:
      year - the year to test
      Returns:
      true if this observance applies