net.finmath.time.daycount
Class DayCountConvention_30E_360
- java.lang.Object
-
- net.finmath.time.daycount.DayCountConvention_30E_360
-
- All Implemented Interfaces:
- DayCountConventionInterface
public class DayCountConvention_30E_360 extends java.lang.Object implements DayCountConventionInterface
Implementation of 30E/360 and 30E+/360. Calculates the day count of 30E/360 as(endDateYear - startDateYear) * 360.0 + (endDateMonth - startDateMonth) * 30.0 + (Math.min(endDateDay, 30.0) - Math.min(startDateDay, 30.0))This day count convention is sometime called Eurobond basis or 30/360 ISMA. For 30E/360 we have that:-
The method
getDaycountcorresponds to the implementation of the "European method" of Excel function DAYS360, i.e., DAYS360(startDate,endDate,TRUE). -
The method
getDaycountFractioncorresponds to the implementation of the "30E/360 method" of Excel function YEARFRAC, i.e., YEARFRAC(startDate,endDate,4).
-
-
Constructor Summary
Constructors Constructor and Description DayCountConvention_30E_360()Create a 30E/360 daycount convention.DayCountConvention_30E_360(boolean is30Eplus360)Create a 30E/360 or 30E+/360 day count 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
public DayCountConvention_30E_360(boolean is30Eplus360)
Create a 30E/360 or 30E+/360 day count convention.- Parameters:
is30Eplus360- If true, then 30E+/360 is constructed, otherwise 30E/360 is constructed.
-
DayCountConvention_30E_360
public DayCountConvention_30E_360()
Create a 30E/360 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