Class SchedulePrototype

  • All Implemented Interfaces:
    Serializable
    Direct Known Subclasses:
    ScheduleMetaData

    public class SchedulePrototype
    extends Object
    implements Serializable
    Class to store any relevant information to generate schedules, which have different period structure but otherwise follow the same conventions.
    Author:
    Christian Fries, Roland Bachl
    See Also:
    Serialized Form
    • Constructor Detail

      • SchedulePrototype

        public SchedulePrototype​(ScheduleGenerator.Frequency frequency,
                                 ScheduleGenerator.DaycountConvention daycountConvention,
                                 ScheduleGenerator.ShortPeriodConvention shortPeriodConvention,
                                 BusinessdayCalendar.DateRollConvention dateRollConvention,
                                 BusinessdayCalendar businessdayCalendar,
                                 int fixingOffsetDays,
                                 int paymentOffsetDays,
                                 boolean isUseEndOfMonth)
        Construct the ScheduleMetaData.
        Parameters:
        frequency - The default frequency.
        daycountConvention - The daycount convention.
        shortPeriodConvention - If short period exists, have it first or last.
        dateRollConvention - Adjustment to be applied to the all dates.
        businessdayCalendar - Businessday calendar (holiday calendar) to be used for date roll adjustment.
        fixingOffsetDays - Number of business days to be added to period start to get the fixing date.
        paymentOffsetDays - Number of business days to be added to period end to get the payment date.
        isUseEndOfMonth - If ShortPeriodConvention is LAST and startDate is an end of month date, all period will be adjusted to EOM. If ShortPeriodConvention is FIRST and maturityDate is an end of month date, all period will be adjusted to EOM.
    • Method Detail

      • getOffsetCodeFromSchedule

        public static String getOffsetCodeFromSchedule​(Schedule schedule)
        Determines the offset code of a forward contract from a schedule. Rounds the average period length to full months.
        Parameters:
        schedule - The schedule.
        Returns:
        The offset code as String
      • getOffsetCodeFromCurveName

        public static String getOffsetCodeFromCurveName​(String curveName)
        Determines the offset code of a forward contract from the name of a forward curve. This method will extract a group of one or more digits together with the first letter behind them, if any. If there are multiple groups of digits in the name, this method will extract the last. If there is no number in the string, this method will return null.
        Parameters:
        curveName - The name of the curve.
        Returns:
        The offset code as String
      • generateScheduleDescriptor

        public ScheduleDescriptor generateScheduleDescriptor​(LocalDate startDate,
                                                             LocalDate endDate)
        Generate a schedule descriptor for the given start and end date.
        Parameters:
        startDate - The start date.
        endDate - The end date.
        Returns:
        The schedule descriptor
      • generateSchedule

        public Schedule generateSchedule​(LocalDate referenceDate,
                                         LocalDate startDate,
                                         LocalDate endDate)
        Generate a schedule for the given start and end date.
        Parameters:
        referenceDate - The reference date (corresponds to \( t = 0 \).
        startDate - The start date.
        endDate - The end date.
        Returns:
        The schedule
      • generateSchedule

        public Schedule generateSchedule​(LocalDate referenceDate,
                                         int maturity,
                                         int termination)
        Generate a schedule with start / end date determined by an offset in months from the reference date.
        Parameters:
        referenceDate - The reference date (corresponds to \( t = 0 \).
        maturity - Offset of the start date to the reference date in months
        termination - Offset of the end date to the start date
        Returns:
        The schedule
      • generateSchedule

        public Schedule generateSchedule​(LocalDate referenceDate,
                                         int maturity,
                                         int termination,
                                         net.finmath.time.SchedulePrototype.OffsetUnit unit)
        Generate a schedule with start / end date determined by an offset from the reference date.
        Parameters:
        referenceDate - The reference date (corresponds to \( t = 0 \).
        maturity - Offset of the start date to the reference date
        termination - Offset of the end date to the start date
        unit - The convention to use for the offset
        Returns:
        The schedule
      • getBusinessdayCalendar

        public BusinessdayCalendar getBusinessdayCalendar()
        Returns:
        the businessdayCalendar
      • getFixingOffsetDays

        public int getFixingOffsetDays()
        Returns:
        the fixingOffsetDays
      • getPaymentOffsetDays

        public int getPaymentOffsetDays()
        Returns:
        the paymentOffsetDays
      • isUseEndOfMonth

        public boolean isUseEndOfMonth()
        Returns:
        the isUseEndOfMonth