class DiscountingKnownAmountPaymentPeriodPricer implements SwapPaymentPeriodPricer<KnownAmountSwapPaymentPeriod> {

  @Override
  public double accruedInterest(KnownAmountSwapPaymentPeriod period, RatesProvider provider) {
    // no day count available, so return the simple day-based fraction
    LocalDate valDate = provider.getValuationDate();
    if (valDate.compareTo(period.getStartDate()) <= 0 || valDate.compareTo(period.getEndDate()) > 0) {
      return 0d;
    }
    double fv = forecastValue(period, provider);
    double totalDays = period.getStartDate().until(period.getEndDate(), DAYS);
    double partialDays = period.getStartDate().until(valDate, DAYS);
    return fv * (partialDays / totalDays);
  }

  public  DiscountingKnownAmountPaymentPeriodPricer(DiscountingPaymentPricer paymentPricer);

}