com.ftlabs.fisa
Class DayCountBasis_Actual

java.lang.Object
  extended by com.ftlabs.fisa.DayCountBasis
      extended by com.ftlabs.fisa.DayCountBasis_Actual
All Implemented Interfaces:
java.io.Serializable

public class DayCountBasis_Actual
extends DayCountBasis

Implementation of the Actual/Actual Day Count Basis.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.ftlabs.fisa.DayCountBasis
_30_360, _30E_360, ACT_360, ACT_365, ACT_365_NL, ACT_ACT
 
Method Summary
 double calculateDays(FISADate date1, FISADate date2, int interestFrequency, boolean eomAdjust)
          Calculates the number of days in a given period using the Actual/Actual Day Count Basis.
 double calculateDaysAccrued(FISADate previousCouponDate, FISADate nextCouponDate, FISADate settlementDate, int interestFrequency, boolean eomAdjust)
          Calculate the number of days accrued within a coupon period.
 double calculateDaysInPeriod(FISADate previousCouponDate, FISADate nextCouponDate, int interestFrequency, boolean eomAdjust)
          Calculate the total number of days in a coupon period.
 double calculateDaysRemaining(FISADate previousCouponDate, FISADate nextCouponDate, FISADate settlementDate, int interestFrequency, boolean eomAdjust)
          Calculate the number of days remaining in a coupon period.
 int getDaysInYear(FISADate date)
          Calculate the number of days for a given year.
 java.lang.String toString()
           
 
Methods inherited from class com.ftlabs.fisa.DayCountBasis
getByName, getSupportedDayCountBases
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

calculateDaysInPeriod

public double calculateDaysInPeriod(FISADate previousCouponDate,
                                    FISADate nextCouponDate,
                                    int interestFrequency,
                                    boolean eomAdjust)
Calculate the total number of days in a coupon period. This implementation returns calculateDays( previousCouponDate, nextCouponDate, security );

Specified by:
calculateDaysInPeriod in class DayCountBasis
Parameters:
previousCouponDate - the previous coupon date.
nextCouponDate - the next coupon date.
interestFrequency - the interestFrequency. The Act/Act implementation ignores this parameter.
eomAdjust - determines whether the end of month adjustment rule is used. The Act/Act implementation ignores this parameter.
Returns:
the number of days within the given period.

calculateDaysAccrued

public double calculateDaysAccrued(FISADate previousCouponDate,
                                   FISADate nextCouponDate,
                                   FISADate settlementDate,
                                   int interestFrequency,
                                   boolean eomAdjust)
Calculate the number of days accrued within a coupon period. This implementation returns calculateDays( previousCouponDate, settlementDate, security );

Specified by:
calculateDaysAccrued in class DayCountBasis
Parameters:
previousCouponDate - the previous coupon date.
nextCouponDate - the next coupon date.
settlementDate - the date on which settlement occurs.
interestFrequency - the interestFrequency. The Act/Act implementation ignores this parameter.
eomAdjust - determines whether the end of month adjustment rule is used. The Act/Act implementation ignores this parameter.
Returns:
the number of days accrued within the given period.

calculateDaysRemaining

public double calculateDaysRemaining(FISADate previousCouponDate,
                                     FISADate nextCouponDate,
                                     FISADate settlementDate,
                                     int interestFrequency,
                                     boolean eomAdjust)
Calculate the number of days remaining in a coupon period. This implementation returns calculateDays( settlementDate, nextCouponDate, security );

Specified by:
calculateDaysRemaining in class DayCountBasis
Parameters:
previousCouponDate - the previous coupon date.
nextCouponDate - the next coupon date.
settlementDate - the date on which settlement occurs.
interestFrequency - the interestFrequency. The Act/Act implementation ignores this parameter.
eomAdjust - determines whether the end of month adjustment rule is used. The Act/Act implementation ignores this parameter.
Returns:
the number of days remaining in the given period.

calculateDays

public double calculateDays(FISADate date1,
                            FISADate date2,
                            int interestFrequency,
                            boolean eomAdjust)
Calculates the number of days in a given period using the Actual/Actual Day Count Basis.

Specified by:
calculateDays in class DayCountBasis
Parameters:
date1 - The starting date of the period.
date2 - The ending date of the period.
interestFrequency - the interestFrequency. The Act/Act implementation ignores this parameter.
eomAdjust - determines whether the end of month adjustment rule is used. The Act/Act implementation ignores this parameter.
Returns:
the number of days within the specified period.

getDaysInYear

public int getDaysInYear(FISADate date)
Calculate the number of days for a given year.

Specified by:
getDaysInYear in class DayCountBasis
Parameters:
date - The date for which the number of days per year will be returned.
Returns:
the actual number of days in the given year if daysInYear is less than or equal to zero, otherwise returns daysInYear.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object