java.lang.Object
net.finmath.time.SchedulePrototype
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ScheduleMetaData
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 Summary
ConstructorsConstructorDescriptionSchedulePrototype(ScheduleGenerator.Frequency frequency, ScheduleGenerator.DaycountConvention daycountConvention, ScheduleGenerator.ShortPeriodConvention shortPeriodConvention, BusinessdayCalendar.DateRollConvention dateRollConvention, BusinessdayCalendar businessdayCalendar, int fixingOffsetDays, int paymentOffsetDays, boolean isUseEndOfMonth)
Construct the ScheduleMetaData. -
Method Summary
Modifier and TypeMethodDescriptiongenerateSchedule(LocalDate referenceDate, int maturity, int termination)
Generate a schedule with start / end date determined by an offset in months from the reference date.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.generateSchedule(LocalDate referenceDate, LocalDate startDate, LocalDate endDate)
Generate a schedule for the given start and end date.generateScheduleDescriptor(LocalDate startDate, LocalDate endDate)
Generate a schedule descriptor for the given start and end date.int
static String
getOffsetCodeFromCurveName(String curveName)
Determines the offset code of a forward contract from the name of a forward curve.static String
getOffsetCodeFromSchedule(Schedule schedule)
Determines the offset code of a forward contract from a schedule.int
boolean
-
Constructor Details
-
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 Details
-
getOffsetCodeFromSchedule
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
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
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
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
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 monthstermination
- 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 datetermination
- Offset of the end date to the start dateunit
- The convention to use for the offset- Returns:
- The schedule
-
getFrequency
- Returns:
- the frequency
-
getDaycountConvention
- Returns:
- the daycountConvention
-
getShortPeriodConvention
- Returns:
- the shortPeriodConvention
-
getDateRollConvention
- Returns:
- the dateRollConvention
-
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
-