java.lang.Object
net.finmath.time.daycount.DayCountConvention_UNKNOWN
- All Implemented Interfaces:
Serializable
,DayCountConvention
Implements a placeholder object for an unknown day count convention, throwing an exception,
whenever a day count or day count fraction is requested.
This class may become handy, if you like to construct products based on possibly incomplete data
where an exception is thrown late, i.e., not at construction time, but at evaluation time.
- Version:
- 1.0
- Author:
- Christian Fries
- See Also:
- Serialized Form
-
Constructor Summary
ConstructorsConstructorDescriptionCreate the unknown day count convention.DayCountConvention_UNKNOWN(String name)
Create the unknown day count 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_UNKNOWN
public DayCountConvention_UNKNOWN()Create the unknown day count convention. -
DayCountConvention_UNKNOWN
Create the unknown day count convention.- Parameters:
name
- A given name, which will be shown in theIllegalArgumentException
when any method is called on this object.
-
-
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.
-