Class DayCountConvention_30E_360_ISDA

java.lang.Object
net.finmath.time.daycount.DayCountConvention_30E_360_ISDA
All Implemented Interfaces:
Serializable, DayCountConvention

public class DayCountConvention_30E_360_ISDA extends Object implements DayCountConvention, Serializable
Implementation of 30E/360 ISDA. Calculates the day count as (endDateYear - startDateYear) * 360.0 + (endDateMonth - startDateMonth) * 30.0 + (Math.min(endDateDay,30) - Math.min(startDateDay, 30.0)); where for endDateDay is the to 30, if endDate is not the termination date and the last day of February. The constructor offers a boolean to decide if endDate is treated as a termination date or not. A termination date is the endDate of the last period in a schedule.
Version:
1.0
Author:
Christian Fries
See Also:
  • Constructor Details

    • DayCountConvention_30E_360_ISDA

      public DayCountConvention_30E_360_ISDA(boolean isTreatEndDateAsTerminationDate)
      Create a 30E/360 ISDA daycount convention.
      Parameters:
      isTreatEndDateAsTerminationDate - If true, the end date is treated as a termination date and that case the last day of february is not treated as 30.
    • DayCountConvention_30E_360_ISDA

      public DayCountConvention_30E_360_ISDA()
      Create a 30E/360 ISDA daycount convention using isTreatEndDateAsTerminationDate = false.
  • Method Details

    • getDaycount

      public double getDaycount(LocalDate startDate, LocalDate endDate)
      Description copied from interface: DayCountConvention
      Return the number of days between startDate and endDate given the specific daycount convention.
      Specified by:
      getDaycount in interface DayCountConvention
      Parameters:
      startDate - The start date given as a LocalDate.
      endDate - The end date given as a LocalDate.
      Returns:
      The number of days within the given period.
    • getDaycountFraction

      public double getDaycountFraction(LocalDate startDate, LocalDate endDate)
      Description copied from interface: DayCountConvention
      Return the daycount fraction (year fraction) corresponding to the period from startDate to endDate given the specific daycount convention.
      Specified by:
      getDaycountFraction in interface DayCountConvention
      Parameters:
      startDate - The start date given as a LocalDate.
      endDate - The end date given as a LocalDate.
      Returns:
      The daycount year fraction corresponding to the given period.