Class ScheduleFromPeriods

java.lang.Object
net.finmath.time.ScheduleFromPeriods
All Implemented Interfaces:
Serializable, Iterable<Period>, Schedule

public class ScheduleFromPeriods extends Object implements Schedule, Serializable
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:
  • Constructor Details

  • Method Details

    • getReferenceDate

      public LocalDate 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 interface Schedule
      Returns:
      The reference data of this schedule corresponding to t=0.
    • getPeriods

      public List<Period> getPeriods()
      Description copied from interface: Schedule
      Returns the array of periods.
      Specified by:
      getPeriods in interface Schedule
      Returns:
      The array of periods.
    • getDaycountconvention

      public DayCountConvention getDaycountconvention()
      Description copied from interface: Schedule
      Returns the daycount convention used to calculate period lengths.
      Specified by:
      getDaycountconvention in interface Schedule
      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 interface Schedule
      Returns:
      The number of periods.
    • getPeriod

      public Period getPeriod(int periodIndex)
      Description copied from interface: Schedule
      Return the period for a given period index.
      Specified by:
      getPeriod in interface Schedule
      Parameters:
      periodIndex - A given period index.
      Returns:
      The period for the 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.
      Specified by:
      getFixing in interface Schedule
      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: Schedule
      Return the payment date converted to the internal daycounting relative to the schedules reference date.
      Specified by:
      getPayment in interface Schedule
      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 interface Schedule
      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 interface Schedule
      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 interface Schedule
      Parameters:
      periodIndex - A given period index.
      Returns:
      The period length for a given period index.
    • iterator

      public Iterator<Period> iterator()
      Specified by:
      iterator in interface Iterable<Period>
    • 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 interface Schedule
      Parameters:
      time - A given time.
      Returns:
      The period index of the .
    • getPeriodIndex

      public int getPeriodIndex(LocalDate date)
      Description copied from interface: Schedule
      Return the index of the period which contains the given date.
      Specified by:
      getPeriodIndex in interface Schedule
      Parameters:
      date - A given date.
      Returns:
      The period index of the .
    • toString

      public String toString()
      Overrides:
      toString in class Object