Class ComposableUnitPeriod

java.lang.Object
org.drip.analytics.cashflow.ComposableUnitPeriod
Direct Known Subclasses:
ComposableUnitFixedPeriod, ComposableUnitFloatingPeriod

public abstract class ComposableUnitPeriod
extends java.lang.Object
ComposableUnitPeriod represents the Cash Flow Periods' Composable Unit Period Details. Currently it holds the Accrual Start Date, the Accrual End Date, the Fixed Coupon, the Basis Spread, the Coupon and the Accrual Day Counts, as well as the EOM Adjustment Flags.

Author:
Lakshmi Krishnamurthy
  • Field Summary

    Fields
    Modifier and Type Field Description
    static int NODE_INSIDE_SEGMENT
    Node is Inside the Period
    static int NODE_LEFT_OF_SEGMENT
    Node is to the Left of the Period
    static int NODE_RIGHT_OF_SEGMENT
    Node is to the Right of the Period
  • Method Summary

    Modifier and Type Method Description
    int accrualCompoundingRule()
    Retrieve the Accrual Compounding Rule
    java.lang.String accrualDC()
    Retrieve the Accrual Day Count
    double accrualDCF​(int iAccrualEnd)
    Get the Period Accrual Day Count Fraction to an Accrual End Date
    boolean accrualEOMAdjustment()
    Retrieve the Accrual EOM Adjustment Flag
    abstract double baseRate​(CurveSurfaceQuoteContainer csqc)
    Get the Period Base Coupon Rate
    abstract double basis()
    Get the Period Coupon Basis
    java.lang.String calendar()
    Retrieve the Calendar
    abstract java.lang.String couponCurrency()
    Get the Period Coupon Currency
    java.lang.String couponDC()
    Retrieve the Coupon Day Count
    boolean couponDCFOffOfFreq()
    Retrieve the Flag indicating whether Coupon DCF is computed off of the DCF Flag
    boolean couponEOMAdjustment()
    Retrieve the Coupon EOM Adjustment Flag
    int dateLocation​(int iDateNode)
    Place the Date Node Location in Relation to the Segment Location
    int endDate()
    Retrieve the Accrual End Date
    int freq()
    Retrieve the Coupon Frequency
    double fullCouponDCF()
    Retrieve the Period Full Coupon DCF
    double fullCouponRate​(CurveSurfaceQuoteContainer csqc)
    Get the Period Full Coupon Rate
    int startDate()
    Retrieve the Accrual Start Date
    java.lang.String tenor()
    Convert the Coupon Frequency into a Tenor

    Methods inherited from class java.lang.Object

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

    • NODE_LEFT_OF_SEGMENT

      public static final int NODE_LEFT_OF_SEGMENT
      Node is to the Left of the Period
      See Also:
      Constant Field Values
    • NODE_INSIDE_SEGMENT

      public static final int NODE_INSIDE_SEGMENT
      Node is Inside the Period
      See Also:
      Constant Field Values
    • NODE_RIGHT_OF_SEGMENT

      public static final int NODE_RIGHT_OF_SEGMENT
      Node is to the Right of the Period
      See Also:
      Constant Field Values
  • Method Details

    • startDate

      public int startDate()
      Retrieve the Accrual Start Date
      Returns:
      The Accrual Start Date
    • endDate

      public int endDate()
      Retrieve the Accrual End Date
      Returns:
      The Accrual End Date
    • freq

      public int freq()
      Retrieve the Coupon Frequency
      Returns:
      The Coupon Frequency
    • couponDC

      public java.lang.String couponDC()
      Retrieve the Coupon Day Count
      Returns:
      The Coupon Day Count
    • couponEOMAdjustment

      public boolean couponEOMAdjustment()
      Retrieve the Coupon EOM Adjustment Flag
      Returns:
      The Coupon EOM Adjustment Flag
    • accrualDC

      public java.lang.String accrualDC()
      Retrieve the Accrual Day Count
      Returns:
      The Accrual Day Count
    • accrualEOMAdjustment

      public boolean accrualEOMAdjustment()
      Retrieve the Accrual EOM Adjustment Flag
      Returns:
      The Accrual EOM Adjustment Flag
    • couponDCFOffOfFreq

      public boolean couponDCFOffOfFreq()
      Retrieve the Flag indicating whether Coupon DCF is computed off of the DCF Flag
      Returns:
      true - The Flag indicating whether Coupon DCF is computed off of the DCF Flag
    • calendar

      public java.lang.String calendar()
      Retrieve the Calendar
      Returns:
      The Calendar
    • accrualCompoundingRule

      public int accrualCompoundingRule()
      Retrieve the Accrual Compounding Rule
      Returns:
      The Accrual Compounding Rule
    • fullCouponDCF

      public double fullCouponDCF()
      Retrieve the Period Full Coupon DCF
      Returns:
      The Period Full Coupon DCF
    • tenor

      public java.lang.String tenor()
      Convert the Coupon Frequency into a Tenor
      Returns:
      The Coupon Frequency converted into a Tenor
    • dateLocation

      public int dateLocation​(int iDateNode)
      Place the Date Node Location in Relation to the Segment Location
      Parameters:
      iDateNode - The Node Ordinate
      Returns:
      One of NODE_LEFT_OF_SEGMENT, NODE_RIGHT_OF_SEGMENT, or NODE_INSIDE_SEGMENT
    • accrualDCF

      public double accrualDCF​(int iAccrualEnd) throws java.lang.Exception
      Get the Period Accrual Day Count Fraction to an Accrual End Date
      Parameters:
      iAccrualEnd - Accrual End Date
      Returns:
      The Accrual DCF
      Throws:
      java.lang.Exception - Thrown if Inputs are Invalid, or if the Date does not lie within the Period
    • fullCouponRate

      public double fullCouponRate​(CurveSurfaceQuoteContainer csqc) throws java.lang.Exception
      Get the Period Full Coupon Rate
      Parameters:
      csqc - The Market Curve and Surface
      Returns:
      The Period Full Coupon Rate
      Throws:
      java.lang.Exception - Thrown if the Full Coupon Rate cannot be calculated
    • baseRate

      public abstract double baseRate​(CurveSurfaceQuoteContainer csqc) throws java.lang.Exception
      Get the Period Base Coupon Rate
      Parameters:
      csqc - The Market Curve and Surface
      Returns:
      The Period Base Coupon Rate
      Throws:
      java.lang.Exception - Thrown if the base Coupon Rate cannot be calculated
    • basis

      public abstract double basis()
      Get the Period Coupon Basis
      Returns:
      The Period Coupon Basis
    • couponCurrency

      public abstract java.lang.String couponCurrency()
      Get the Period Coupon Currency
      Returns:
      The Period Coupon Currency