class CouponIborFxResetDiscountingMethod {

  public MultipleCurrencyAmount currencyExposure(final CouponIborFxReset coupon,
      final MulticurveProviderInterface multicurves) {
    ArgumentChecker.notNull(coupon, "coupon");
    ArgumentChecker.notNull(multicurves, "multicurves");
    double forward = multicurves.getSimplyCompoundForwardRate(coupon.getIndex(),
        coupon.getIborIndexFixingPeriodStartTime(), coupon.getIborIndexFixingPeriodEndTime(),
        coupon.getIborIndexFixingAccrualFactor());
    double tp = coupon.getPaymentTime();
    double t0 = coupon.getFxDeliveryTime();
    Currency ccyPayment = coupon.getCurrency();
    Currency ccyReference = coupon.getReferenceCurrency();
    double dfCcyPaymentAtPayment = multicurves.getDiscountFactor(ccyPayment, tp);
    double dfCcyReferenceAtDelivery = multicurves.getDiscountFactor(ccyReference, t0);
    double dfCcyPaymentAtDelivery = multicurves.getDiscountFactor(ccyPayment, t0);
    double notionalRef = coupon.getNotional();
    double pvRef = (forward + coupon.getSpread()) * coupon.getPaymentYearFraction() * notionalRef *
        dfCcyPaymentAtPayment * dfCcyReferenceAtDelivery / dfCcyPaymentAtDelivery;
    return MultipleCurrencyAmount.of(ccyReference, pvRef);
  }

  private  CouponIborFxResetDiscountingMethod();

}