/// <summary>Initializes a new instance of the <see cref="IndividualDateScheduleFrequency"/> class. /// </summary> /// <param name="frequencyTenor">The frequency tenor.</param> /// <exception cref="ArgumentException">Thrown, if <paramref name="frequencyTenor"/> represents a /// tenor with a negative sign or the null-tenor.</exception> /// <remarks>The <see cref="Name"/> will be set to the <see cref="System.String"/> representation of /// <paramref name="frequencyTenor"/>.</remarks> public IndividualDateScheduleFrequency(TenorTimeSpan frequencyTenor) { if (TenorTimeSpan.IsNull(frequencyTenor) || (frequencyTenor.IsPositive == false)) { throw new ArgumentException("frequencyTenor"); } m_FrequencyTenor = frequencyTenor; string frequencyTenorAsString = frequencyTenor.ToString(); m_Name = new IdentifierString(frequencyTenorAsString); m_LongName = new IdentifierString(String.Format(DateFactoryResources.IndividualLongName, frequencyTenorAsString)); }
/// <summary>Initializes a new instance of the <see cref="IRCapletTenorConventionConstant"/> class. /// </summary> /// <param name="liborRateTenor">The (unique) libor rate tenor.</param> /// <exception cref="ArgumentException">Thrown, if <paramref name="liborRateTenor"/> represents a tenor leq or equal <c>0</c>.</exception> public IRCapletTenorConventionConstant(TenorTimeSpan liborRateTenor) { if (TenorTimeSpan.IsNull(liborRateTenor) || (liborRateTenor.IsPositive == false)) { throw new ArgumentException("liborRateTenor"); } m_LiborRateTenor = liborRateTenor.AsFrequency(); m_Name = new IdentifierString(String.Format("Constant caplet tenor {0}", liborRateTenor.ToString())); m_LongName = new IdentifierString(String.Format(IRCapletTenorConventionResources.ConstantTenorLongName, liborRateTenor.ToString())); }
/// <summary>Initializes a new instance of the <see cref="ForwardStartingTimeframeDescription"/> class. /// </summary> /// <param name="startDateTenor">The tenor use to calculate the start date.</param> /// <param name="tenor">The tenor that represents the time span.</param> /// <param name="spotDateAdjustment">A business day convention used to compute the spot date, i.e. reference date + a number of business days to settle (if <paramref name="startDateTenor"/> is regular).</param> /// <param name="startDateAdjustment">A business day convention used to compute the start date of the period.</param> /// <param name="endDateAdjustment">A business day convention used to compute the end date of the period.</param> /// <param name="businessDaysToSettle">The number of business days used to calculate the spot date; this parameter will be taken into if and only if <paramref name="startDateTenor"/> is a regular tenor (i.e. neigther overnight nor tomorrow-next).</param> /// <exception cref="ArgumentException">Thrown, if <paramref name="startDateTenor"/> or <paramref name="tenor"/> represents a negative time span or <paramref name="tenor"/> does not represents a regular tenor (<see cref="TenorType.RegularTenor"/>).</exception> /// <exception cref="ArgumentNullException">Thrown, if one of the <see cref="IBusinessDayConvention"/> arguments is <c>null</c>.</exception> public ForwardStartingTimeframeDescription(TenorTimeSpan startDateTenor, TenorTimeSpan tenor, IBusinessDayConvention spotDateAdjustment, IBusinessDayConvention startDateAdjustment, IBusinessDayConvention endDateAdjustment, int businessDaysToSettle = 0) { if (startDateTenor.IsPositive == false) { throw new ArgumentException(String.Format(ExceptionMessages.ArgumentIsInvalid, startDateTenor.ToString()), "startDateTenor"); } StartDateTenor = startDateTenor; if ((tenor.IsPositive == false) || (tenor.TenorType != TenorType.RegularTenor)) // ON, TN are not allowed { throw new ArgumentException(String.Format(ExceptionMessages.ArgumentIsInvalid, tenor.ToString()), "tenor"); } Tenor = tenor; if (spotDateAdjustment == null) { throw new ArgumentNullException("spotDateAdjustment"); } SpotDateAdjustment = spotDateAdjustment; if (startDateAdjustment == null) { throw new ArgumentNullException("startDateAdjustment"); } StartDateAdjustment = startDateAdjustment; if (endDateAdjustment == null) { throw new ArgumentNullException("endDateAdjustment"); } EndDateAdjustment = endDateAdjustment; BusinessDaysToSettle = businessDaysToSettle; }
/// <summary>Returns a <see cref="System.String"/> that represents this instance. /// </summary> /// <returns>A <see cref="System.String"/> that represents this instance.</returns> public override string ToString() { return(StartDateTenor.ToString() + "x" + Tenor.ToString()); }
/// <summary>Initializes a new instance of the <see cref="TenorTimeframeDescription"/> class. /// </summary> /// <param name="tenor">The tenor that represents the time span.</param> /// <param name="spotDateAdjustment">A business day convention used to compute the spot date, i.e. reference date + a number of business days to settle (if <paramref name="tenor"/> is regular).</param> /// <param name="startDateAdjustment">A business day convention used to compute the start date of the period.</param> /// <param name="endDateAdjustment">A business day convention used to compute the end date of the period.</param> /// <param name="businessDaysToSettle">The number of business days used to calculate the spot date; this parameter will be taken into if and only if <paramref name="tenor"/> is a regular tenor (i.e. neigther overnight nor tomorrow-next).</param> /// <exception cref="ArgumentException">Thrown, if <paramref name="tenor"/> represents a negative time span.</exception> /// <exception cref="ArgumentNullException">Thrown, if one of the <see cref="IBusinessDayConvention"/> arguments is <c>null</c>.</exception> public TenorTimeframeDescription(TenorTimeSpan tenor, IBusinessDayConvention spotDateAdjustment, IBusinessDayConvention startDateAdjustment, IBusinessDayConvention endDateAdjustment, int businessDaysToSettle = 0) { if (tenor.IsPositive == false) { throw new ArgumentException(String.Format(ExceptionMessages.ArgumentIsInvalid, tenor.ToString()), "tenor"); } Tenor = tenor; if (spotDateAdjustment == null) { throw new ArgumentNullException("spotDateAdjustment"); } SpotDateAdjustment = spotDateAdjustment; if (startDateAdjustment == null) { throw new ArgumentNullException("startDateAdjustment"); } StartDateAdjustment = startDateAdjustment; if (endDateAdjustment == null) { throw new ArgumentNullException("endDateAdjustment"); } EndDateAdjustment = endDateAdjustment; BusinessDaysToSettle = businessDaysToSettle; }
/// <summary>Returns a <see cref="System.String"/> that represents this instance. /// </summary> /// <returns>A <see cref="System.String"/> that represents this instance.</returns> public override string ToString() { return(Tenor.ToString()); }