Class CompositePeriodBuilder

java.lang.Object
org.drip.analytics.support.CompositePeriodBuilder

public class CompositePeriodBuilder
extends java.lang.Object
CompositePeriodBuilder exposes the composite period construction functionality.

Author:
Lakshmi Krishnamurthy
  • Field Details

    • EDGE_DATE_SEQUENCE_FORWARD

      public static final int EDGE_DATE_SEQUENCE_FORWARD
      Edge Date Generation Sequence - Forward
      See Also:
      Constant Field Values
    • EDGE_DATE_SEQUENCE_REVERSE

      public static final int EDGE_DATE_SEQUENCE_REVERSE
      Edge Date Generation Sequence - Reverse
      See Also:
      Constant Field Values
    • EDGE_DATE_SEQUENCE_REGULAR

      public static final int EDGE_DATE_SEQUENCE_REGULAR
      Edge Date Generation Sequence - Regular
      See Also:
      Constant Field Values
    • EDGE_DATE_SEQUENCE_OVERNIGHT

      public static final int EDGE_DATE_SEQUENCE_OVERNIGHT
      Edge Date Generation Sequence - Overnight
      See Also:
      Constant Field Values
    • EDGE_DATE_SEQUENCE_SINGLE

      public static final int EDGE_DATE_SEQUENCE_SINGLE
      Edge Date Generation Sequence - Single Edge Date Pair Between Dates
      See Also:
      Constant Field Values
    • SHORT_STUB

      public static final int SHORT_STUB
      Period Set Generation Customization - Short Stub (i.e., No adjustment on either end)
      See Also:
      Constant Field Values
    • FULL_FRONT_PERIOD

      public static final int FULL_FRONT_PERIOD
      Period Set Generation Customization - Merge the front periods to produce a long front
      See Also:
      Constant Field Values
    • LONG_STUB

      public static final int LONG_STUB
      Period Set Generation Customization - Long Stub (if present) belongs to the front/back end depending upon backwards/forwards generation scheme
      See Also:
      Constant Field Values
    • REFERENCE_PERIOD_IN_ARREARS

      public static final int REFERENCE_PERIOD_IN_ARREARS
      Reference Period Fixing is IN-ARREARS (i.e., displaced one period to the right) of the Coupon Period
      See Also:
      Constant Field Values
    • REFERENCE_PERIOD_IN_ADVANCE

      public static final int REFERENCE_PERIOD_IN_ADVANCE
      Reference Period Fixing is IN-ADVANCE (i.e., the same as that) of the Coupon Period
      See Also:
      Constant Field Values
    • ACCRUAL_COMPOUNDING_RULE_ARITHMETIC

      public static final int ACCRUAL_COMPOUNDING_RULE_ARITHMETIC
      Accrual Compounding Rule - Arithmetic
      See Also:
      Constant Field Values
    • ACCRUAL_COMPOUNDING_RULE_GEOMETRIC

      public static final int ACCRUAL_COMPOUNDING_RULE_GEOMETRIC
      Accrual Compounding Rule - Geometric
      See Also:
      Constant Field Values
  • Constructor Details

    • CompositePeriodBuilder

      public CompositePeriodBuilder()
  • Method Details

    • ValidateCompoundingRule

      public static final boolean ValidateCompoundingRule​(int iAccrualCompoundingRule)
      Verify if the Specified Accrual Compounding Rule is a Valid One
      Parameters:
      iAccrualCompoundingRule - The Accrual Compounding Rule
      Returns:
      TRUE - The Accrual Compounding Rule is valid
    • ForwardEdgeDates

      public static final java.util.List<java.lang.Integer> ForwardEdgeDates​(JulianDate dtEffective, JulianDate dtMaturity, java.lang.String strTenor, DateAdjustParams dap, int iPSEC)
      Generate a list of period edge dates forward from the start.
      Parameters:
      dtEffective - Effective date
      dtMaturity - Maturity date
      strTenor - Period Tenor
      dap - Inner Date Adjustment Parameters
      iPSEC - Period Set Edge Customizer Setting
      Returns:
      List of Period Edge Dates
    • BackwardEdgeDates

      public static final java.util.List<java.lang.Integer> BackwardEdgeDates​(JulianDate dtEffective, JulianDate dtMaturity, java.lang.String strTenor, DateAdjustParams dap, int iPSEC)
      Generate a list of period edge dates backward from the end.
      Parameters:
      dtEffective - Effective date
      dtMaturity - Maturity date
      strTenor - Period Tenor
      dap - Inner Date Adjustment Parameters
      iPSEC - Period Set Edge Customizer Setting
      Returns:
      List of Period Edge Dates
    • RegularEdgeDates

      public static final java.util.List<java.lang.Integer> RegularEdgeDates​(JulianDate dtEffective, java.lang.String strPeriodTenor, java.lang.String strMaturityTenor, DateAdjustParams dap)
      Generate a list of regular period edge dates forward from the start.
      Parameters:
      dtEffective - Effective date
      strPeriodTenor - Period Tenor
      strMaturityTenor - Period Tenor
      dap - Inner Date Adjustment Parameters
      Returns:
      List of Period Edge Dates
    • RegularEdgeDates

      public static final java.util.List<java.lang.Integer> RegularEdgeDates​(int iStartDate, int iEndDate, java.lang.String strPeriodTenor, DateAdjustParams dap)
      Generate a list of regular period edge dates forward from the start.
      Parameters:
      iStartDate - Start Date
      iEndDate - End Date
      strPeriodTenor - Period Tenor
      dap - Inner Date Adjustment Parameters
      Returns:
      List of Period Edge Dates
    • IMMEdgeDates

      public static final java.util.List<java.lang.Integer> IMMEdgeDates​(JulianDate dtSpot, int iRollMonths, java.lang.String strPeriodTenor, java.lang.String strMaturityTenor, DateAdjustParams dap)
      Generate a list of the IMM period edge dates forward from the spot date.
      Parameters:
      dtSpot - Spot Date
      iRollMonths - Number of Months to Roll to the Next IMM Date
      strPeriodTenor - Period Tenor
      strMaturityTenor - Period Tenor
      dap - Inner Date Adjustment Parameters
      Returns:
      List of IMM Period Edge Dates
    • OvernightEdgeDates

      public static final java.util.List<java.lang.Integer> OvernightEdgeDates​(JulianDate dtStart, JulianDate dtEnd, java.lang.String strCalendar)
      Generate the List of Overnight Edge Dates between the specified dates, using the specified Calendar
      Parameters:
      dtStart - Start Date
      dtEnd - End Date
      strCalendar - Calendar
      Returns:
      List of Overnight Edge Dates
    • EdgePair

      public static final java.util.List<java.lang.Integer> EdgePair​(JulianDate dtStart, JulianDate dtEnd)
      Generate a single Spanning Edge Pair between the specified dates, using the specified Calendar
      Parameters:
      dtStart - Start Date
      dtEnd - End Date
      Returns:
      List Containing the Pair
    • ReferencePeriod

      public static final ReferenceIndexPeriod ReferencePeriod​(JulianDate dtStart, JulianDate dtEnd, FloaterLabel floaterLabel, int iReferencePeriodArrearsType)
      Construct a Reference Period using the Start/End Dates, the Floater Label, and the Reference Period Arrears Type
      Parameters:
      dtStart - Start Date
      dtEnd - End Date
      floaterLabel - Floater Label
      iReferencePeriodArrearsType - Reference Period Arrears Type
      Returns:
      The Reference Period
    • ForwardEdgeDates

      public static final java.util.List<java.lang.Integer> ForwardEdgeDates​(int iEffective, int iMaturity, java.lang.String strTenor, DateAdjustParams dap, int iPSEC)
      Generate a list of period edge dates forward from the start.
      Parameters:
      iEffective - Effective Date
      iMaturity - Maturity Date
      strTenor - Period Tenor
      dap - Inner Date Adjustment Parameters
      iPSEC - Period Set Edge Customizer Setting
      Returns:
      List of Period Edge Dates
    • BackwardEdgeDates

      public static final java.util.List<java.lang.Integer> BackwardEdgeDates​(int iEffective, int iMaturity, java.lang.String strTenor, DateAdjustParams dap, int iPSEC)
      Generate a list of period edge dates backward from the end.
      Parameters:
      iEffective - Effective Date
      iMaturity - Maturity Date
      strTenor - Period Tenor
      dap - Inner Date Adjustment Parameters
      iPSEC - Period Set Edge Customizer Setting
      Returns:
      List of Period Edge Dates
    • RegularEdgeDates

      public static final java.util.List<java.lang.Integer> RegularEdgeDates​(int iEffective, java.lang.String strPeriodTenor, java.lang.String strMaturityTenor, DateAdjustParams dap)
      Generate a list of regular period edge dates forward from the start.
      Parameters:
      iEffective - Effective Date
      strPeriodTenor - Period Tenor
      strMaturityTenor - Period Tenor
      dap - Inner Date Adjustment Parameters
      Returns:
      List of Period Edge Dates
    • OvernightEdgeDates

      public static final java.util.List<java.lang.Integer> OvernightEdgeDates​(int iStartDate, int iEndDate, java.lang.String strCalendar)
      Generate the List of Overnight Edge Dates between the specified dates, using the specified Calendar
      Parameters:
      iStartDate - Start Date
      iEndDate - End Date
      strCalendar - Calendar
      Returns:
      List of Overnight Edge Dates
    • ReferencePeriod

      public static final ReferenceIndexPeriod ReferencePeriod​(int iStartDate, int iEndDate, FloaterLabel floaterLabel, int iReferencePeriodArrearsType)
      Construct a Reference Index Period using the Start/End Dates, the Floater Label, and the Reference Period Arrears Type
      Parameters:
      iStartDate - Start Date
      iEndDate - End Date
      floaterLabel - Floater Label
      iReferencePeriodArrearsType - Reference Period Arrears Type
      Returns:
      The Reference Period
    • UnitDateEdges

      public static final java.util.List<java.lang.Integer> UnitDateEdges​(int iUnitPeriodStartDate, int iUnitPeriodEndDate, java.lang.String strCalendar, ComposableUnitBuilderSetting cubs)
      Retrieve the List of Edge Dates across all Units
      Parameters:
      iUnitPeriodStartDate - Unit Period Start Date
      iUnitPeriodEndDate - Unit Period End Date
      strCalendar - Unit Date Generation Calendar
      cubs - Composable Unit Builder Setting
      Returns:
      List of Edge Dates across all Units
    • FixedUnits

      public static final java.util.List<ComposableUnitPeriod> FixedUnits​(int iUnitPeriodStartDate, int iUnitPeriodEndDate, UnitCouponAccrualSetting ucas, ComposableFixedUnitSetting cfus)
      Construct the List of Composable Fixed Units from the inputs
      Parameters:
      iUnitPeriodStartDate - Unit Period Start Date
      iUnitPeriodEndDate - Unit Period End Date
      ucas - Unit Coupon/Accrual Setting
      cfus - Composable Fixed Unit Setting
      Returns:
      The List of Composable Floating Units
    • FloatingUnits

      public static final java.util.List<ComposableUnitPeriod> FloatingUnits​(int iUnitPeriodStartDate, int iUnitPeriodEndDate, ComposableFloatingUnitSetting cfus)
      Construct the List of Composable Floating Units from the inputs
      Parameters:
      iUnitPeriodStartDate - Unit Period Start Date
      iUnitPeriodEndDate - Unit Period End Date
      cfus - Composable Floating Unit Setting
      Returns:
      The List of Composable Floating Units
    • FixedCompositeUnit

      public static final java.util.List<CompositePeriod> FixedCompositeUnit​(java.util.List<java.lang.Integer> lsCompositeEdgeDate, CompositePeriodSetting cps, UnitCouponAccrualSetting ucas, ComposableFixedUnitSetting cfus)
      Construct the List of Composite Fixed Periods from the corresponding Composable Fixed Period Units
      Parameters:
      lsCompositeEdgeDate - The Composite Period Edge Dates
      cps - Composite Period Setting Instance
      ucas - Unit Coupon/Accrual Setting
      cfus - Composable Fixed Unit Setting
      Returns:
      List of Composite Fixed Periods
    • FloatingCompositeUnit

      public static final java.util.List<CompositePeriod> FloatingCompositeUnit​(java.util.List<java.lang.Integer> lsCompositeEdgeDate, CompositePeriodSetting cps, ComposableFloatingUnitSetting cfus)
      Construct the List of Composite Floating Period from the corresponding Composable Floating Period Units
      Parameters:
      lsCompositeEdgeDate - The Composite Period Edge Dates
      cps - Composite Period Setting Instance
      cfus - Composable Floating Unit Setting
      Returns:
      List of Composite Floating Periods