Class Weekend

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

public class Weekend
extends java.lang.Object
Weekend holds the left and the right weekend days. It provides functionality to retrieve them, check if the given day is a weekend, and serialize/de-serialize weekend days.

Author:
Lakshmi Krishnamurthy
  • Constructor Summary

    Constructors
    Constructor Description
    Weekend​(int[] aiDay)
    Create the weekend instance object from the array of the weekend days
  • Method Summary

    Modifier and Type Method Description
    int[] days()
    Retrieve the weekend days
    boolean isLeftWeekend​(int iDate)
    Is the given date a left weekend day
    boolean isRightWeekend​(double dblDate)
    Is the given date a right weekend day
    boolean isWeekend​(int iDate)
    Is the given date a weekend day
    static Weekend StandardWeekend()
    Create a Weekend Instance with SATURDAY and SUNDAY

    Methods inherited from class java.lang.Object

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

    • Weekend

      public Weekend​(int[] aiDay) throws java.lang.Exception
      Create the weekend instance object from the array of the weekend days
      Parameters:
      aiDay - Array of the weekend days
      Throws:
      java.lang.Exception - Thrown if cannot properly de-serialize Weekend
  • Method Details

    • StandardWeekend

      public static final Weekend StandardWeekend()
      Create a Weekend Instance with SATURDAY and SUNDAY
      Returns:
      Weekend object
    • days

      public int[] days()
      Retrieve the weekend days
      Returns:
      Array of the weekend days
    • isLeftWeekend

      public boolean isLeftWeekend​(int iDate)
      Is the given date a left weekend day
      Parameters:
      iDate - Date
      Returns:
      True (Left weekend day)
    • isRightWeekend

      public boolean isRightWeekend​(double dblDate)
      Is the given date a right weekend day
      Parameters:
      dblDate - Date
      Returns:
      True (Right weekend day)
    • isWeekend

      public boolean isWeekend​(int iDate)
      Is the given date a weekend day
      Parameters:
      iDate - Date
      Returns:
      True (Weekend day)