Package org.drip.analytics.support
Class CompositePeriodBuilder
java.lang.Object
org.drip.analytics.support.CompositePeriodBuilder
public class CompositePeriodBuilder
extends java.lang.Object
CompositePeriodBuilder exposes the composite period construction functionality.
- Module = Product Core Module
- Library = Fixed Income Analytics
- Project = Date, Cash Flow, and Cash Flow Period Measure Generation Utilities
- Package = Assorted Support and Helper Utilities
- Author:
- Lakshmi Krishnamurthy
-
Field Summary
Fields Modifier and Type Field Description static int
ACCRUAL_COMPOUNDING_RULE_ARITHMETIC
Accrual Compounding Rule - Arithmeticstatic int
ACCRUAL_COMPOUNDING_RULE_GEOMETRIC
Accrual Compounding Rule - Geometricstatic int
EDGE_DATE_SEQUENCE_FORWARD
Edge Date Generation Sequence - Forwardstatic int
EDGE_DATE_SEQUENCE_OVERNIGHT
Edge Date Generation Sequence - Overnightstatic int
EDGE_DATE_SEQUENCE_REGULAR
Edge Date Generation Sequence - Regularstatic int
EDGE_DATE_SEQUENCE_REVERSE
Edge Date Generation Sequence - Reversestatic int
EDGE_DATE_SEQUENCE_SINGLE
Edge Date Generation Sequence - Single Edge Date Pair Between Datesstatic int
FULL_FRONT_PERIOD
Period Set Generation Customization - Merge the front periods to produce a long frontstatic int
LONG_STUB
Period Set Generation Customization - Long Stub (if present) belongs to the front/back end depending upon backwards/forwards generation schemestatic int
REFERENCE_PERIOD_IN_ADVANCE
Reference Period Fixing is IN-ADVANCE (i.e., the same as that) of the Coupon Periodstatic int
REFERENCE_PERIOD_IN_ARREARS
Reference Period Fixing is IN-ARREARS (i.e., displaced one period to the right) of the Coupon Periodstatic int
SHORT_STUB
Period Set Generation Customization - Short Stub (i.e., No adjustment on either end) -
Constructor Summary
Constructors Constructor Description CompositePeriodBuilder()
-
Method Summary
Modifier and Type Method Description static 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.static 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.static java.util.List<java.lang.Integer>
EdgePair(JulianDate dtStart, JulianDate dtEnd)
Generate a single Spanning Edge Pair between the specified dates, using the specified Calendarstatic 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 Unitsstatic java.util.List<ComposableUnitPeriod>
FixedUnits(int iUnitPeriodStartDate, int iUnitPeriodEndDate, UnitCouponAccrualSetting ucas, ComposableFixedUnitSetting cfus)
Construct the List of Composable Fixed Units from the inputsstatic 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 Unitsstatic java.util.List<ComposableUnitPeriod>
FloatingUnits(int iUnitPeriodStartDate, int iUnitPeriodEndDate, ComposableFloatingUnitSetting cfus)
Construct the List of Composable Floating Units from the inputsstatic 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.static 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.static 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.static 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 Calendarstatic 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 Calendarstatic 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 Typestatic 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 Typestatic 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.static 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.static 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.static 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 Unitsstatic boolean
ValidateCompoundingRule(int iAccrualCompoundingRule)
Verify if the Specified Accrual Compounding Rule is a Valid OneMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
EDGE_DATE_SEQUENCE_FORWARD
public static final int EDGE_DATE_SEQUENCE_FORWARDEdge Date Generation Sequence - Forward- See Also:
- Constant Field Values
-
EDGE_DATE_SEQUENCE_REVERSE
public static final int EDGE_DATE_SEQUENCE_REVERSEEdge Date Generation Sequence - Reverse- See Also:
- Constant Field Values
-
EDGE_DATE_SEQUENCE_REGULAR
public static final int EDGE_DATE_SEQUENCE_REGULAREdge Date Generation Sequence - Regular- See Also:
- Constant Field Values
-
EDGE_DATE_SEQUENCE_OVERNIGHT
public static final int EDGE_DATE_SEQUENCE_OVERNIGHTEdge Date Generation Sequence - Overnight- See Also:
- Constant Field Values
-
EDGE_DATE_SEQUENCE_SINGLE
public static final int EDGE_DATE_SEQUENCE_SINGLEEdge Date Generation Sequence - Single Edge Date Pair Between Dates- See Also:
- Constant Field Values
-
SHORT_STUB
public static final int SHORT_STUBPeriod 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_PERIODPeriod Set Generation Customization - Merge the front periods to produce a long front- See Also:
- Constant Field Values
-
LONG_STUB
public static final int LONG_STUBPeriod 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_ARREARSReference 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_ADVANCEReference 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_ARITHMETICAccrual Compounding Rule - Arithmetic- See Also:
- Constant Field Values
-
ACCRUAL_COMPOUNDING_RULE_GEOMETRIC
public static final int ACCRUAL_COMPOUNDING_RULE_GEOMETRICAccrual 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 datedtMaturity
- Maturity datestrTenor
- Period Tenordap
- Inner Date Adjustment ParametersiPSEC
- 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 datedtMaturity
- Maturity datestrTenor
- Period Tenordap
- Inner Date Adjustment ParametersiPSEC
- 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 datestrPeriodTenor
- Period TenorstrMaturityTenor
- Period Tenordap
- 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 DateiEndDate
- End DatestrPeriodTenor
- Period Tenordap
- 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 DateiRollMonths
- Number of Months to Roll to the Next IMM DatestrPeriodTenor
- Period TenorstrMaturityTenor
- Period Tenordap
- 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 DatedtEnd
- End DatestrCalendar
- 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 DatedtEnd
- 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 DatedtEnd
- End DatefloaterLabel
- Floater LabeliReferencePeriodArrearsType
- 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 DateiMaturity
- Maturity DatestrTenor
- Period Tenordap
- Inner Date Adjustment ParametersiPSEC
- 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 DateiMaturity
- Maturity DatestrTenor
- Period Tenordap
- Inner Date Adjustment ParametersiPSEC
- 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 DatestrPeriodTenor
- Period TenorstrMaturityTenor
- Period Tenordap
- 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 DateiEndDate
- End DatestrCalendar
- 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 DateiEndDate
- End DatefloaterLabel
- Floater LabeliReferencePeriodArrearsType
- 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 DateiUnitPeriodEndDate
- Unit Period End DatestrCalendar
- Unit Date Generation Calendarcubs
- 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 DateiUnitPeriodEndDate
- Unit Period End Dateucas
- Unit Coupon/Accrual Settingcfus
- 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 DateiUnitPeriodEndDate
- Unit Period End Datecfus
- 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 Datescps
- Composite Period Setting Instanceucas
- Unit Coupon/Accrual Settingcfus
- 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 Datescps
- Composite Period Setting Instancecfus
- Composable Floating Unit Setting- Returns:
- List of Composite Floating Periods
-