/**
* Copyright (C) 2009 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.financial.convention.daycount;
import org.threeten.bp.LocalDate;
/**
* The 1/1 day count convention.
* <p>
* The 1/1 day count always returns one as the fraction of a year.
*/
public class OneOneDayCount extends StatelessDayCount {
/** Serialization version. */
private static final long serialVersionUID = 1L;
@Override
public double getDayCountFraction(final LocalDate firstDate, final LocalDate secondDate) {
return 1;
}
@Override
public double getAccruedInterest(final LocalDate previousCouponDate, final LocalDate date, final LocalDate nextCouponDate, final double coupon, final double paymentsPerYear) {
return coupon / paymentsPerYear;
}
@Override
public String getName() {
return "1/1";
}
}