org.jfin.date.daycount.defaultimpl
Class ISDAActualActual
- java.lang.Object
-
- org.jfin.date.daycount.DaycountCalculator
-
- org.jfin.date.daycount.defaultimpl.ISDAActualActual
-
public class ISDAActualActual extends DaycountCalculator
Based upon the implementation from QuantLib http://www.quantlib.org/ If startCalendar and endCalendar are equal dates, returns zero.
-
-
Constructor Summary
Constructors Constructor and Description ISDAActualActual()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublecalculateDaycountFraction(java.util.Calendar startCalendar, java.util.Calendar endCalendar)Calculates the ISDA Actual actual day count fraction between two dates.doublecalculateDaycountFraction(java.util.Calendar startCalendar, java.util.Calendar endCalendar, java.util.Calendar periodStartCalendar, java.util.Calendar periodEndCalendar)Calculates the ISDA Actual actual day count fraction between two dates.int[]getDenominators(java.util.List<Period> subPeriods)Calculates the denominators for a set of periodsint[]getNumerators(java.util.List<Period> subPeriods)Calculates the numerators for a set of periodsjava.util.List<Period>getPeriods(java.util.Calendar startCalendar, java.util.Calendar endCalendar)Generate a list of the sub periods (up to and including year boundaries) that are required to calculate the ISDA Actual Actual day count fraction-
Methods inherited from class org.jfin.date.daycount.DaycountCalculator
calculateDaycountFraction, daysBetween
-
-
-
-
Method Detail
-
calculateDaycountFraction
public double calculateDaycountFraction(java.util.Calendar startCalendar, java.util.Calendar endCalendar) throws DaycountExceptionCalculates the ISDA Actual actual day count fraction between two dates.- Specified by:
calculateDaycountFractionin classDaycountCalculator- Returns:
- The day count fraction of a year
- Throws:
DaycountException
-
calculateDaycountFraction
public double calculateDaycountFraction(java.util.Calendar startCalendar, java.util.Calendar endCalendar, java.util.Calendar periodStartCalendar, java.util.Calendar periodEndCalendar) throws DaycountExceptionCalculates the ISDA Actual actual day count fraction between two dates. ISDA Actual/Actual does not vary depending on the reference period, so this is exactly equivelent to calling calculateDaycountFraction(startCalendar, endCalendar)- Specified by:
calculateDaycountFractionin classDaycountCalculator- Returns:
- The day count fraction of a year
- Throws:
DaycountException
-
getPeriods
public java.util.List<Period> getPeriods(java.util.Calendar startCalendar, java.util.Calendar endCalendar)
Generate a list of the sub periods (up to and including year boundaries) that are required to calculate the ISDA Actual Actual day count fraction- Parameters:
startCalendar- The start calendar of the periodendCalendar- The end calendar of the period- Returns:
- A list of sub periods between the start and end calendars
-
getNumerators
public int[] getNumerators(java.util.List<Period> subPeriods)
Calculates the numerators for a set of periods- Parameters:
subPeriods- A list of the sub periods- Returns:
- An array of type int containing the numberators for the periods
-
getDenominators
public int[] getDenominators(java.util.List<Period> subPeriods)
Calculates the denominators for a set of periods- Parameters:
subPeriods- A list of the sub periods- Returns:
- An array of type int containing the denominators of the sub periods
-
-
DataMelt 3.0 © DataMelt by jWork.ORG