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.double
getFixing(int periodIndex)
Return the fixing converted to the internal daycounting relative to the schedules reference date.int
Returns the number of periods.double
getPayment(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.double
getPeriodEnd(int periodIndex)
Return the period end date converted to the internal daycounting relative to the schedules reference date.int
getPeriodIndex(double time)
Return the index of the period which contains the given time point.int
getPeriodIndex(LocalDate date)
Return the index of the period which contains the given date.double
getPeriodLength(int periodIndex)
Return the period length for a given period index.Returns the array of periods.double
getPeriodStart(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, wait
Methods 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:Schedule
Returns 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:
getReferenceDate
in interfaceSchedule
- Returns:
- The reference data of this schedule corresponding to t=0.
-
getPeriods
Description copied from interface:Schedule
Returns the array of periods.- Specified by:
getPeriods
in interfaceSchedule
- Returns:
- The array of periods.
-
getDaycountconvention
Description copied from interface:Schedule
Returns the daycount convention used to calculate period lengths.- Specified by:
getDaycountconvention
in interfaceSchedule
- Returns:
- The daycount convention used to calculate period lengths.
-
getNumberOfPeriods
public int getNumberOfPeriods()Description copied from interface:Schedule
Returns the number of periods.- Specified by:
getNumberOfPeriods
in interfaceSchedule
- Returns:
- The number of periods.
-
getPeriod
Description copied from interface:Schedule
Return the period for a given period index. -
getFixing
public double getFixing(int periodIndex)Description copied from interface:Schedule
Return the fixing converted to the internal daycounting relative to the schedules reference date. -
getPayment
public double getPayment(int periodIndex)Description copied from interface:Schedule
Return the payment date converted to the internal daycounting relative to the schedules reference date.- Specified by:
getPayment
in 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:Schedule
Return the period start date converted to the internal daycounting relative to the schedules reference date.- Specified by:
getPeriodStart
in 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:Schedule
Return the period end date converted to the internal daycounting relative to the schedules reference date.- Specified by:
getPeriodEnd
in 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:Schedule
Return the period length for a given period index.- Specified by:
getPeriodLength
in 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:Schedule
Return the index of the period which contains the given time point.- Specified by:
getPeriodIndex
in interfaceSchedule
- Parameters:
time
- A given time.- Returns:
- The period index of the .
-
getPeriodIndex
Description copied from interface:Schedule
Return the index of the period which contains the given date.- Specified by:
getPeriodIndex
in interfaceSchedule
- Parameters:
date
- A given date.- Returns:
- The period index of the .
-
toString
-