class CouponONArithmeticAverage extends Coupon {

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

  private  CouponONArithmeticAverage(final Currency currency, final double paymentTime, final double paymentYearFraction, final double notional, final IndexON index,
      final double[] fixingPeriodStartTimes,
      final double[] fixingPeriodEndTimes, final double[] fixingPeriodAccrualFactors, final double rateAccrued, final double fixingPeriodRemainingAccrualFactor);

}