net.finmath.time.daycount
Class DayCountConvention_UNKNOWN
- java.lang.Object
-
- net.finmath.time.daycount.DayCountConvention_UNKNOWN
-
- All Implemented Interfaces:
- DayCountConventionInterface
public class DayCountConvention_UNKNOWN extends java.lang.Object implements DayCountConventionInterface
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.
-
-
Constructor Summary
Constructors Constructor and Description DayCountConvention_UNKNOWN()Create the unknown day count convention.DayCountConvention_UNKNOWN(java.lang.String name)Create the unknown 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_UNKNOWN
public DayCountConvention_UNKNOWN()
Create the unknown day count convention.
-
DayCountConvention_UNKNOWN
public DayCountConvention_UNKNOWN(java.lang.String name)
Create the unknown day count convention.- Parameters:
name- A given name, which will be shown in theIllegalArgumentExceptionwhen any method is called on this object.
-
-
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