net.finmath.time.daycount
Class DayCountConventionFactory
- java.lang.Object
-
- net.finmath.time.daycount.DayCountConventionFactory
-
public class DayCountConventionFactory extends java.lang.ObjectFactory methods for day count conventions.
-
-
Constructor Summary
Constructors Constructor and Description DayCountConventionFactory()Factory methods for day count conventions.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static java.util.CalendargetCalendarForData(java.util.Date date)Returns a java.util.Calendar for a given java.util.Date.static doublegetDaycount(java.util.Date startDate, java.util.Date endDate, java.lang.String convention)Return the number of days between startDate and endDate given the specific daycount convention.static DayCountConventionInterfacegetDayCountConvention(java.lang.String convention)Create a day count convention base on a convention string.static doublegetDaycountFraction(java.util.Date startDate, java.util.Date endDate, java.lang.String convention)Return the daycount fraction corresponding to the period from startDate to endDate given the specific daycount convention.
-
-
-
Constructor Detail
-
DayCountConventionFactory
public DayCountConventionFactory()
Factory methods for day count conventions.
-
-
Method Detail
-
getDayCountConvention
public static DayCountConventionInterface getDayCountConvention(java.lang.String convention)
Create a day count convention base on a convention string. The follwoing convention strings are supported- act/act isda
- 30/360
- 30E/360
- 30U/360
- act/360
- act/365
- act/act yearfrac
- Parameters:
convention- A convention string.- Returns:
- A day count convention object.
-
getDaycount
public static double getDaycount(java.util.Date startDate, java.util.Date endDate, java.lang.String convention)Return the number of days between startDate and endDate given the specific daycount convention.- Parameters:
startDate- The start date given as aDate.endDate- The end date given as aDate.convention- A convention string.- Returns:
- The number of days within the given period.
-
getDaycountFraction
public static double getDaycountFraction(java.util.Date startDate, java.util.Date endDate, java.lang.String convention)Return the daycount fraction corresponding to the period from startDate to endDate given the specific daycount convention.- Parameters:
startDate- The start date given as aDate.endDate- The end date given as aDate.convention- A convention string.- Returns:
- The daycount fraction corresponding to the given period.
-
getCalendarForData
public static java.util.Calendar getCalendarForData(java.util.Date date)
Returns a java.util.Calendar for a given java.util.Date.- Parameters:
date- A Date- Returns:
- The corresponding calendar
-
-
DataMelt 3.0 © DataMelt by jWork.ORG