class CouponONArithmeticAverageSpread extends Coupon {

  public static CouponONArithmeticAverageSpread from(final double paymentTime, final double paymentAccrualFactor, final double notional, final IndexON index, final double[] fixingPeriodTimes,
      final double[] fixingPeriodAccrualFactors,
      final double rateAccrued, final double spread) {
    ArgumentChecker.notNull(index, "Index");
    ArgumentChecker.notNull(fixingPeriodTimes, "Fixing Times");
    ArgumentChecker.notNull(fixingPeriodAccrualFactors, "Accrual Factors");
    double fixingPeriodRemainingAccrualFactor = 0.0;
    for (final double fixingPeriodAccrualFactor : fixingPeriodAccrualFactors) {
      fixingPeriodRemainingAccrualFactor += fixingPeriodAccrualFactor;
    }
    return new CouponONArithmeticAverageSpread(index.getCurrency(), paymentTime, paymentAccrualFactor, notional, index, fixingPeriodTimes, fixingPeriodAccrualFactors, rateAccrued,
        fixingPeriodRemainingAccrualFactor, spread);
  }

  private  CouponONArithmeticAverageSpread(final Currency currency, final double paymentTime, final double paymentYearFraction, final double notional, final IndexON index,
      final double[] fixingPeriodTimes, final double[] fixingPeriodAccrualFactors, final double rateAccrued, final double fixingPeriodRemainingAccrualFactor, final double spread);

}