Class ChristmasEveEarlyClose

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

public class ChristmasEveEarlyClose extends AbstractObservance
Observance of the Singapore Exchange's (SGX) Christmas Eve half-day close (December 24). SGX's securities/equities market runs a half-day trading session (09:00-12:00 SGT) on December 24 whenever that date falls on a trading day; when December 24 falls on a Saturday or Sunday, the half-day close is simply not observed that year — it is not shifted to another date. isValidYear(int) is overridden here to signal that business-rule absence, while computeDate(int) unconditionally returns December 24.

Verified against SGX's Rulebook Regulatory/Practice Notice 8.2.1 ("Trading Hours, Market Phases...") and cross-checked against SGX's published trading calendars, 2018-2026.

Author:
Dave Joyce
  • Constructor Details

    • ChristmasEveEarlyClose

      public ChristmasEveEarlyClose()
  • 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