net.finmath.time.daycount
Class DayCountConvention_30E_360_ISDA
- java.lang.Object
-
- net.finmath.time.daycount.DayCountConvention_30E_360_ISDA
-
- All Implemented Interfaces:
- DayCountConventionInterface
public class DayCountConvention_30E_360_ISDA extends java.lang.Object implements DayCountConventionInterface
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.
-
-
Constructor Summary
Constructors Constructor and Description DayCountConvention_30E_360_ISDA()Create a 30E/360 ISDA daycount convention.DayCountConvention_30E_360_ISDA(boolean isTreatEndDateAsTerminationDate)Create a 30E/360 ISDA daycount convention.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublegetDaycount(java.util.Calendar startDate, java.util.Calendar endDate)Return the number of days between startDate and endDate given the specific daycount convention.doublegetDaycountFraction(java.util.Calendar startDate, java.util.Calendar endDate)Return the daycount fraction corresponding to the period from startDate to endDate given the specific daycount convention.
-
-
-
Constructor Detail
-
DayCountConvention_30E_360_ISDA
public DayCountConvention_30E_360_ISDA(boolean isTreatEndDateAsTerminationDate)
Create a 30E/360 ISDA daycount convention.
-
DayCountConvention_30E_360_ISDA
public DayCountConvention_30E_360_ISDA()
Create a 30E/360 ISDA daycount convention.
-
-
Method Detail
-
getDaycount
public double getDaycount(java.util.Calendar startDate, java.util.Calendar endDate)Description copied from interface:DayCountConventionInterfaceReturn the number of days between startDate and endDate given the specific daycount convention.- Specified by:
getDaycountin interfaceDayCountConventionInterface- Parameters:
startDate- The start date given as aCalendar.endDate- The end date given as aCalendar.- Returns:
- The number of days within the given period.
-
getDaycountFraction
public double getDaycountFraction(java.util.Calendar startDate, java.util.Calendar endDate)Description copied from interface:DayCountConventionInterfaceReturn the daycount fraction corresponding to the period from startDate to endDate given the specific daycount convention.- Specified by:
getDaycountFractionin interfaceDayCountConventionInterface- Parameters:
startDate- The start date given as aCalendar.endDate- The end date given as aCalendar.- Returns:
- The daycount fraction corresponding to the given period.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG