Module org.holiday.calendar.apac
Class NewYearsEveEarlyClose
java.lang.Object
org.holiday.calendar.observance.AbstractObservance
org.holiday.calendar.observance.sg.NewYearsEveEarlyClose
Observance of the Singapore Exchange's (SGX) New Year's Eve half-day close
(December 31). SGX's securities/equities market runs a half-day trading
session (09:00-12:00 SGT) on December 31 whenever that date falls on a
trading day; when December 31 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 31.
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 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
-
NewYearsEveEarlyClose
public NewYearsEveEarlyClose()
-
-
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
-