com.ftlabs.fisa
Class DayCountBasis_30_360

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

public class DayCountBasis_30_360
extends DayCountBasis

Implementation of the 30/360 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 earlierDate, FISADate laterDate, int interestFrequency, boolean eomAdjust)
          Calculate the number of days between two dates using the 30/360 Day Count method.
 double calculateDaysAccrued(FISADate previousCouponDate, FISADate nextCouponDate, FISADate settlementDate, int interestFrequency, boolean eomAdjust)
          Calculate the number of days accrued within a coupon period using the 30/360 day count method.
 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 360/interestFrequency.

Specified by:
calculateDaysInPeriod in class DayCountBasis
Parameters:
previousCouponDate - the previous coupon date.
nextCouponDate - the next coupon date.
interestFrequency - the interestFrequency.
eomAdjust - determines whether the end of month adjustment rule is used.
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 using the 30/360 day count method.

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.
eomAdjust - determines whether the end of month adjustment rule is used.
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 daysInPeriod - daysAccrued.

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.
eomAdjust - determines whether the end of month adjustment rule is used.
Returns:
the number of days remaining in the given period.

calculateDays

public double calculateDays(FISADate earlierDate,
                            FISADate laterDate,
                            int interestFrequency,
                            boolean eomAdjust)
Calculate the number of days between two dates using the 30/360 Day Count method.

Specified by:
calculateDays in class DayCountBasis
Parameters:
earlierDate - The starting date of the period.
laterDate - The ending date of the period.
interestFrequency - the interestFrequency.
eomAdjust - determines whether the end of month adjustment rule is used.
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:
360. For 30/360, every year is considered to have 360 days.

toString

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