java.lang.Object
net.finmath.time.ScheduleFromPeriods
- All Implemented Interfaces:
Serializable,Iterable<Period>,Schedule
A schedule of interest rate periods with
a fixing and payment.
The periods have two representations: one a
Period
which contains LocalDate dates and
an alternative representation using doubles.
Within a schedule, the mapping from doubles to dates is one to one.- Version:
- 1.0
- Author:
- Christian Fries
- See Also:
- Serialized Form
-
Constructor Summary
ConstructorsConstructorDescriptionScheduleFromPeriods(LocalDate referenceDate, List<Period> periods, DayCountConvention daycountconvention)ScheduleFromPeriods(LocalDate referenceDate, DayCountConvention daycountconvention, Period... periods) -
Method Summary
Modifier and TypeMethodDescriptionReturns 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.intReturns the number of periods.doublegetPayment(int periodIndex)Return the payment date converted to the internal daycounting relative to the schedules reference date.getPeriod(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.intgetPeriodIndex(double time)Return the index of the period which contains the given time point.intgetPeriodIndex(LocalDate date)Return the index of the period which contains the given date.doublegetPeriodLength(int periodIndex)Return the period length for a given period index.Returns the array of periods.doublegetPeriodStart(int periodIndex)Return the period start date converted to the internal daycounting relative to the schedules reference date.Returns the reference data of this schedule.iterator()toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ScheduleFromPeriods
public ScheduleFromPeriods(LocalDate referenceDate, DayCountConvention daycountconvention, Period... periods) -
ScheduleFromPeriods
public ScheduleFromPeriods(LocalDate referenceDate, List<Period> periods, DayCountConvention daycountconvention)
-
-
Method Details
-
getReferenceDate
Description copied from interface:ScheduleReturns 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 interfaceSchedule- Returns:
- The reference data of this schedule corresponding to t=0.
-
getPeriods
Description copied from interface:ScheduleReturns the array of periods.- Specified by:
getPeriodsin interfaceSchedule- Returns:
- The array of periods.
-
getDaycountconvention
Description copied from interface:ScheduleReturns the daycount convention used to calculate period lengths.- Specified by:
getDaycountconventionin interfaceSchedule- Returns:
- The daycount convention used to calculate period lengths.
-
getNumberOfPeriods
public int getNumberOfPeriods()Description copied from interface:ScheduleReturns the number of periods.- Specified by:
getNumberOfPeriodsin interfaceSchedule- Returns:
- The number of periods.
-
getPeriod
Description copied from interface:ScheduleReturn the period for a given period index. -
getFixing
public double getFixing(int periodIndex)Description copied from interface:ScheduleReturn the fixing converted to the internal daycounting relative to the schedules reference date. -
getPayment
public double getPayment(int periodIndex)Description copied from interface:ScheduleReturn the payment date converted to the internal daycounting relative to the schedules reference date.- Specified by:
getPaymentin interfaceSchedule- 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:ScheduleReturn the period start date converted to the internal daycounting relative to the schedules reference date.- Specified by:
getPeriodStartin interfaceSchedule- 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:ScheduleReturn the period end date converted to the internal daycounting relative to the schedules reference date.- Specified by:
getPeriodEndin interfaceSchedule- 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:ScheduleReturn the period length for a given period index.- Specified by:
getPeriodLengthin interfaceSchedule- Parameters:
periodIndex- A given period index.- Returns:
- The period length for a given period index.
-
iterator
-
getPeriodIndex
public int getPeriodIndex(double time)Description copied from interface:ScheduleReturn the index of the period which contains the given time point.- Specified by:
getPeriodIndexin interfaceSchedule- Parameters:
time- A given time.- Returns:
- The period index of the .
-
getPeriodIndex
Description copied from interface:ScheduleReturn the index of the period which contains the given date.- Specified by:
getPeriodIndexin interfaceSchedule- Parameters:
date- A given date.- Returns:
- The period index of the .
-
toString
-