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:
- Serialized Form
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a 30E/360 ISDA daycount convention usingisTreatEndDateAsTerminationDate = false
.DayCountConvention_30E_360_ISDA(boolean isTreatEndDateAsTerminationDate)
Create a 30E/360 ISDA daycount convention. -
Method Summary
Modifier and TypeMethodDescriptiondouble
getDaycount(LocalDate startDate, LocalDate endDate)
Return the number of days between startDate and endDate given the specific daycount convention.double
getDaycountFraction(LocalDate startDate, LocalDate endDate)
Return the daycount fraction (year fraction) corresponding to the period from startDate to endDate given the specific daycount convention.
-
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 usingisTreatEndDateAsTerminationDate = false
.
-
-
Method Details
-
getDaycount
Description copied from interface:DayCountConvention
Return the number of days between startDate and endDate given the specific daycount convention.- Specified by:
getDaycount
in interfaceDayCountConvention
- Parameters:
startDate
- The start date given as aLocalDate
.endDate
- The end date given as aLocalDate
.- Returns:
- The number of days within the given period.
-
getDaycountFraction
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 interfaceDayCountConvention
- Parameters:
startDate
- The start date given as aLocalDate
.endDate
- The end date given as aLocalDate
.- Returns:
- The daycount year fraction corresponding to the given period.
-