Class Locale

java.lang.Object
org.drip.analytics.eventday.Locale

public class Locale
extends java.lang.Object
Locale contains the set of regular holidays and the weekend holidays for a location. It also provides the functionality to add custom holidays and weekends.

Author:
Lakshmi Krishnamurthy
  • Constructor Summary

    Constructors
    Constructor Description
    Locale()
    Construct an empty LocHolidays instance
  • Method Summary

    Modifier and Type Method Description
    boolean addFixedHoliday​(int iDay, int iMonth, java.lang.String strDescription)
    Add a fixed holiday from the day and month
    boolean addFloatingHoliday​(int iWeekInMonth, int iWeekDay, int iMonth, boolean bFromFront, java.lang.String strDescription)
    Add a floating holiday from the week in month, the day in week, the month, and whether holidays are calculated from front/back.
    boolean addStandardWeekend()
    Add the regular SATURDAY/SUNDAY weekend
    boolean addStaticHoliday​(java.lang.String strDate, java.lang.String strDescription)
    Add the given string date as a static holiday
    boolean addStaticHoliday​(JulianDate dt, java.lang.String strDescription)
    Add the given date as a static holiday
    boolean addWeekend​(int[] aiDays)
    Add the array of weekend days
    java.util.Set<Base> holidays()
    Return the set of week day holidays
    Weekend weekendDays()
    Return the weekend

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Locale

      public Locale()
      Construct an empty LocHolidays instance
  • Method Details

    • addWeekend

      public boolean addWeekend​(int[] aiDays)
      Add the array of weekend days
      Parameters:
      aiDays - Array of weekend days
      Returns:
      Succeeded (true), failure (false)
    • addStandardWeekend

      public boolean addStandardWeekend()
      Add the regular SATURDAY/SUNDAY weekend
      Returns:
      Succeeded (true), failure (false)
    • addStaticHoliday

      public boolean addStaticHoliday​(JulianDate dt, java.lang.String strDescription)
      Add the given date as a static holiday
      Parameters:
      dt - Date
      strDescription - Description
      Returns:
      Succeeded (true), failure (false)
    • addStaticHoliday

      public boolean addStaticHoliday​(java.lang.String strDate, java.lang.String strDescription)
      Add the given string date as a static holiday
      Parameters:
      strDate - Date string
      strDescription - Description
      Returns:
      Succeeded (true), failure (false)
    • addFixedHoliday

      public boolean addFixedHoliday​(int iDay, int iMonth, java.lang.String strDescription)
      Add a fixed holiday from the day and month
      Parameters:
      iDay - Day
      iMonth - Month
      strDescription - Description
      Returns:
      Succeeded (true), failure (false)
    • addFloatingHoliday

      public boolean addFloatingHoliday​(int iWeekInMonth, int iWeekDay, int iMonth, boolean bFromFront, java.lang.String strDescription)
      Add a floating holiday from the week in month, the day in week, the month, and whether holidays are calculated from front/back.
      Parameters:
      iWeekInMonth - Week in the Month
      iWeekDay - Day in the week
      iMonth - Month
      bFromFront - Holidays are calculated from the start of the month (True)
      strDescription - Description
      Returns:
      Succeeded (true), failure (false)
    • weekendDays

      public Weekend weekendDays()
      Return the weekend
      Returns:
      Weekend
    • holidays

      public java.util.Set<Base> holidays()
      Return the set of week day holidays
      Returns:
      Set of hoidays