Package fr.marcwrobel.jbanking.calendar
Enum FinancialCalendars
- java.lang.Object
-
- java.lang.Enum<FinancialCalendars>
-
- fr.marcwrobel.jbanking.calendar.FinancialCalendars
-
- All Implemented Interfaces:
Calendar,Serializable,Comparable<FinancialCalendars>
public enum FinancialCalendars extends Enum<FinancialCalendars> implements Calendar
A non-exhaustive list ofCalendars for some of the most important financial districts or financial systems in the world.For the time being only financial districts or financial systems that express their holidays using the gregorian calendar are supported.
Those calendars are valid from 2000 until further notice.
- Since:
- 2.1.0
- Author:
- Marc Wrobel
-
-
Enum Constant Summary
Enum Constants Enum Constant Description FRANKFURTFrankfurt (Germany) financial district holidays.FRIDAY_SATURDAYA special calendar with no holidays but with saturday and sunday as weekends.LONDONLondon (United Kingdom) financial district holidays.NEW_YORK_FEDFederal Reserve Bank of New York holidays.NEW_YORK_SOCK_EXCHANGENew York Stock Exchange (NYSE) holidays.NO_HOLIDAYSA special calendar with no holidays and no weekends.PARISParis (France) financial district holidays.SATURDAY_SUNDAYA special calendar with no holidays but with saturday and sunday as weekends.SYDNEYSydney (Australia) financial district holidays.TARGETThe calendar for Trans-European Automated Real-time Gross settlement Express Transfer (TARGET) closing days.TOKYOTokyo (Japan) financial district holidays.
-
Field Summary
-
Fields inherited from interface fr.marcwrobel.jbanking.calendar.Calendar
MAX_ITERATIONS
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<LocalDate>businessDaysWithin(LocalDate from, LocalDate to)Compute the business days betweenfrom(inclusive) andto(inclusive).Set<Holiday>getHolidaysFor(LocalDate date)Get all theHolidays matching with the given day.List<LocalDate>holidaysWithin(LocalDate from, LocalDate to)Compute the holidays betweenfrom(inclusive) andto(inclusive).booleanisBusinessDay(LocalDate date)Check whether the given date is a business day.booleanisHoliday(LocalDate date)Check whether the given date is a public holiday.LocalDatenext(LocalDate date)Compute the next business day after the given date (excluded).LocalDateprevious(LocalDate date)Compute the previous business day before the given date (excluded).static FinancialCalendarsvalueOf(String name)Returns the enum constant of this type with the specified name.static FinancialCalendars[]values()Returns an array containing the constants of this enum type, in the order they are declared.-
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Methods inherited from interface fr.marcwrobel.jbanking.calendar.Calendar
nextOrSame, previousOrSame, shift
-
-
-
-
Enum Constant Detail
-
NO_HOLIDAYS
public static final FinancialCalendars NO_HOLIDAYS
A special calendar with no holidays and no weekends. All days are business days. It may be used to indicate that a holiday calendar does not apply.
-
SATURDAY_SUNDAY
public static final FinancialCalendars SATURDAY_SUNDAY
A special calendar with no holidays but with saturday and sunday as weekends.Note that not all countries use saturday and sunday weekends.
-
FRIDAY_SATURDAY
public static final FinancialCalendars FRIDAY_SATURDAY
A special calendar with no holidays but with saturday and sunday as weekends.Note that not all countries use saturday and sunday weekends.
-
FRANKFURT
public static final FinancialCalendars FRANKFURT
Frankfurt (Germany) financial district holidays.Note that 2017 was the 500th anniversary of the act by Martin Luther which stated the Reformation. In Germany, the 31st of October was a national holiday that year. More on this bbc.com article.
- See Also:
- tradinghours.com, timeanddate.com
-
LONDON
public static final FinancialCalendars LONDON
London (United Kingdom) financial district holidays.- See Also:
- timeanddate.com
-
NEW_YORK_FED
public static final FinancialCalendars NEW_YORK_FED
Federal Reserve Bank of New York holidays.- See Also:
- newyorkfed.org
-
NEW_YORK_SOCK_EXCHANGE
public static final FinancialCalendars NEW_YORK_SOCK_EXCHANGE
New York Stock Exchange (NYSE) holidays.- See Also:
- nyse.com
-
PARIS
public static final FinancialCalendars PARIS
Paris (France) financial district holidays.
-
SYDNEY
public static final FinancialCalendars SYDNEY
Sydney (Australia) financial district holidays.- See Also:
- timeanddate.com, Reserve Bank of Australia
-
TARGET
public static final FinancialCalendars TARGET
The calendar for Trans-European Automated Real-time Gross settlement Express Transfer (TARGET) closing days.- See Also:
- ecb.europa.eu
-
TOKYO
public static final FinancialCalendars TOKYO
Tokyo (Japan) financial district holidays.This calendar is valid from 2007 until further notice. Last verification occurred on 2021-02-19.
- See Also:
- Holiday Schedule of the Bank of Japan
-
-
Method Detail
-
values
public static FinancialCalendars[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (FinancialCalendars c : FinancialCalendars.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static FinancialCalendars valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
isHoliday
public boolean isHoliday(LocalDate date)
Description copied from interface:CalendarCheck whether the given date is a public holiday.- Specified by:
isHolidayin interfaceCalendar- Parameters:
date- a non-null date.- Returns:
trueif the given date is a holiday,falseotherwise.- See Also:
Calendar.isHoliday(LocalDate)
-
getHolidaysFor
public Set<Holiday> getHolidaysFor(LocalDate date)
Description copied from interface:CalendarGet all theHolidays matching with the given day.- Specified by:
getHolidaysForin interfaceCalendar- Parameters:
date- a non-null and unmodifiable set ofHolidays.- Returns:
trueif the given date is a holiday,falseotherwise.- See Also:
Calendar.getHolidaysFor(LocalDate)
-
isBusinessDay
public boolean isBusinessDay(LocalDate date)
Description copied from interface:CalendarCheck whether the given date is a business day.- Specified by:
isBusinessDayin interfaceCalendar- Parameters:
date- a non-null date.- Returns:
trueif the given date is a business day,falseotherwise.- See Also:
Calendar.isBusinessDay(LocalDate)
-
previous
public LocalDate previous(LocalDate date)
Description copied from interface:CalendarCompute the previous business day before the given date (excluded).- Specified by:
previousin interfaceCalendar- Parameters:
date- a non-null date- Returns:
- a non-null date
- See Also:
Calendar.previous(LocalDate)
-
next
public LocalDate next(LocalDate date)
Description copied from interface:CalendarCompute the next business day after the given date (excluded).- Specified by:
nextin interfaceCalendar- Parameters:
date- a non-null date- Returns:
- a non-null date
- See Also:
Calendar.next(LocalDate)
-
holidaysWithin
public List<LocalDate> holidaysWithin(LocalDate from, LocalDate to)
Description copied from interface:CalendarCompute the holidays betweenfrom(inclusive) andto(inclusive).- Specified by:
holidaysWithinin interfaceCalendar- Parameters:
from- a non-null dateto- a non-null date- Returns:
- a non-null and unmodifiable ordered list of dates
- See Also:
Calendar.holidaysWithin(LocalDate, LocalDate)
-
businessDaysWithin
public List<LocalDate> businessDaysWithin(LocalDate from, LocalDate to)
Description copied from interface:CalendarCompute the business days betweenfrom(inclusive) andto(inclusive).- Specified by:
businessDaysWithinin interfaceCalendar- Parameters:
from- a non-null dateto- a non-null date- Returns:
- a non-null and unmodifiable ordered list of dates
- See Also:
Calendar.businessDaysWithin(LocalDate, LocalDate)
-
-