net.finmath.time
Class Schedule
- java.lang.Object
-
- net.finmath.time.Schedule
-
- All Implemented Interfaces:
- java.lang.Iterable<Period>, ScheduleInterface
public class Schedule extends java.lang.Object implements ScheduleInterface
A schedule of interest rate periods with a fixing and payment. The periods have two representations: one aPeriodwhich containsCalendardates and an alternative representation using doubles. Within a schedule, the mapping from doubles to dates is one to one.
-
-
Constructor Summary
Constructors Constructor and Description Schedule(java.util.Calendar referenceDate, DayCountConventionInterface daycountconvention, Period... periods)Schedule(java.util.Calendar referenceDate, java.util.List<Period> periods, DayCountConventionInterface daycountconvention)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description DayCountConventionInterfacegetDaycountconvention()Returns the daycount convention used to calculate period lengths.doublegetFixing(int periodIndex)Return the fixing converted to the internal daycounting relative to the schedules reference date.intgetNumberOfPeriods()Returns the number of periods.doublegetPayment(int periodIndex)Return the payment date converted to the internal daycounting relative to the schedules reference date.PeriodgetPeriod(int periodIndex)Return the period for a given period index.doublegetPeriodEnd(int periodIndex)Return the period end date converted to the internal daycounting relative to the schedules reference date.doublegetPeriodLength(int periodIndex)Return the period length for a given period index.java.util.List<Period>getPeriods()Returns the array of periods.doublegetPeriodStart(int periodIndex)Return the period start date converted to the internal daycounting relative to the schedules reference date.java.util.CalendargetReferenceDate()Returns the reference data of this schedule.java.util.Iterator<Period>iterator()java.lang.StringtoString()
-
-
-
Constructor Detail
-
Schedule
public Schedule(java.util.Calendar referenceDate, DayCountConventionInterface daycountconvention, Period... periods)
-
Schedule
public Schedule(java.util.Calendar referenceDate, java.util.List<Period> periods, DayCountConventionInterface daycountconvention)
-
-
Method Detail
-
getReferenceDate
public java.util.Calendar getReferenceDate()
Description copied from interface:ScheduleInterfaceReturns the reference data of this schedule. The reference date is only used to convert dates to doubles using and internal daycount conventions (ACT/365) which does not need to agree with the daycount convention used to calculate period length.- Specified by:
getReferenceDatein interfaceScheduleInterface- Returns:
- The reference data of this schedule corresponding to t=0.
-
getPeriods
public java.util.List<Period> getPeriods()
Description copied from interface:ScheduleInterfaceReturns the array of periods.- Specified by:
getPeriodsin interfaceScheduleInterface- Returns:
- The array of periods.
-
getDaycountconvention
public DayCountConventionInterface getDaycountconvention()
Description copied from interface:ScheduleInterfaceReturns the daycount convention used to calculate period lengths.- Specified by:
getDaycountconventionin interfaceScheduleInterface- Returns:
- The daycount convention used to calculate period lengths.
-
getNumberOfPeriods
public int getNumberOfPeriods()
Description copied from interface:ScheduleInterfaceReturns the number of periods.- Specified by:
getNumberOfPeriodsin interfaceScheduleInterface- Returns:
- The number of periods.
-
getPeriod
public Period getPeriod(int periodIndex)
Description copied from interface:ScheduleInterfaceReturn the period for a given period index.- Specified by:
getPeriodin interfaceScheduleInterface- Parameters:
periodIndex- A given period index.- Returns:
- The period for the given period index.
-
getFixing
public double getFixing(int periodIndex)
Description copied from interface:ScheduleInterfaceReturn the fixing converted to the internal daycounting relative to the schedules reference date.- Specified by:
getFixingin interfaceScheduleInterface- Parameters:
periodIndex- A given period index.- Returns:
- The fixing converted to the internal daycounting relative to the schedules reference date.
-
getPayment
public double getPayment(int periodIndex)
Description copied from interface:ScheduleInterfaceReturn the payment date converted to the internal daycounting relative to the schedules reference date.- Specified by:
getPaymentin interfaceScheduleInterface- Parameters:
periodIndex- A given period index.- Returns:
- The payment date converted to the internal daycounting relative to the schedules reference date.
-
getPeriodStart
public double getPeriodStart(int periodIndex)
Description copied from interface:ScheduleInterfaceReturn the period start date converted to the internal daycounting relative to the schedules reference date.- Specified by:
getPeriodStartin interfaceScheduleInterface- Parameters:
periodIndex- A given period index.- Returns:
- The period start date converted to the internal daycounting relative to the schedules reference date.
-
getPeriodEnd
public double getPeriodEnd(int periodIndex)
Description copied from interface:ScheduleInterfaceReturn the period end date converted to the internal daycounting relative to the schedules reference date.- Specified by:
getPeriodEndin interfaceScheduleInterface- Parameters:
periodIndex- A given period index.- Returns:
- The period end date converted to the internal daycounting relative to the schedules reference date.
-
getPeriodLength
public double getPeriodLength(int periodIndex)
Description copied from interface:ScheduleInterfaceReturn the period length for a given period index.- Specified by:
getPeriodLengthin interfaceScheduleInterface- Parameters:
periodIndex- A given period index.- Returns:
- The period length for a given period index.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG