org.jfin.date.daycount
Class DaycountCalculator
- java.lang.Object
-
- org.jfin.date.daycount.DaycountCalculator
-
- Direct Known Subclasses:
- Actual360, Actual365Fixed, Actual366, AFBActualActual, Business252, EU30360, ISDAActualActual, ISMAActualActual, IT30360, US30360
public abstract class DaycountCalculator extends java.lang.ObjectBase class for DaycountCalculators. Used to interrogate the concrete instances of daycount basis calculators for day count fractions between two dates, or accross a period.
-
-
Constructor Summary
Constructors Constructor and Description DaycountCalculator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description abstract doublecalculateDaycountFraction(java.util.Calendar startCalendar, java.util.Calendar endCalendar)Calculates the daycount fraction of the period represented by the startCalendar and endCalendarabstract doublecalculateDaycountFraction(java.util.Calendar startCalendar, java.util.Calendar endCalendar, java.util.Calendar periodStartCalendar, java.util.Calendar periodEndCalendar)Calculates the daycount fraction of the period represented by the startCalendar and endCalendar with reference to the period represented by periodStartCalendar and periodEndCalendar.doublecalculateDaycountFraction(Period period)Calculates the daycount fraction of the period; from the startCalendar to the endCalendar.longdaysBetween(java.util.Calendar d1, java.util.Calendar d2)Returns the nearest calculation of the number of calendar days between two Calendars.
-
-
-
Method Detail
-
calculateDaycountFraction
public double calculateDaycountFraction(Period period) throws DaycountException
Calculates the daycount fraction of the period; from the startCalendar to the endCalendar.- Parameters:
period-- Returns:
- The day count fraction of a year
- Throws:
DaycountException
-
calculateDaycountFraction
public abstract double calculateDaycountFraction(java.util.Calendar startCalendar, java.util.Calendar endCalendar) throws DaycountExceptionCalculates the daycount fraction of the period represented by the startCalendar and endCalendar- Parameters:
startCalendar-endCalendar-- Returns:
- The day count fraction of a year
- Throws:
DaycountException
-
calculateDaycountFraction
public abstract double calculateDaycountFraction(java.util.Calendar startCalendar, java.util.Calendar endCalendar, java.util.Calendar periodStartCalendar, java.util.Calendar periodEndCalendar) throws DaycountExceptionCalculates the daycount fraction of the period represented by the startCalendar and endCalendar with reference to the period represented by periodStartCalendar and periodEndCalendar. Used when the period represented by startCalendar and endCalendar is a long or short stub period, the periodStartCalendar and periodEndCalendar represent the 'notional' period as if it were a full period and not a stub- Parameters:
startCalendar-endCalendar-periodStartCalendar-periodEndCalendar-- Returns:
- The day count fraction of a year
- Throws:
DaycountException
-
daysBetween
public long daysBetween(java.util.Calendar d1, java.util.Calendar d2)Returns the nearest calculation of the number of calendar days between two Calendars.- Parameters:
d1-d2-- Returns:
- The number of days between the two Calendars
-
-
DataMelt 3.0 © DataMelt by jWork.ORG