class SwaptionBermudaFixedIborDefinition implements InstrumentDefinition<SwaptionBermudaFixedIbor> {

  @Override
  public SwaptionBermudaFixedIbor toDerivative(final ZonedDateTime date) {
    ArgumentChecker.notNull(date, "date");
    final int nbExpiry = _expiryDate.length;
    final double[] expiryTime = new double[nbExpiry];
    final double[] settleTime = new double[nbExpiry];
    @SuppressWarnings("unchecked")
    final SwapFixedCoupon<Coupon>[] expirySwap = new SwapFixedCoupon[nbExpiry];
    for (int loopexp = 0; loopexp < nbExpiry; loopexp++) {
      expiryTime[loopexp] = TimeCalculator.getTimeBetween(date, _expiryDate[loopexp]);
      expirySwap[loopexp] = _underlyingSwap[loopexp].toDerivative(date);
      settleTime[loopexp] = TimeCalculator.getTimeBetween(date, _underlyingSwap[loopexp].getFixedLeg().getNthPayment(0).getAccrualStartDate());
    }
    return new SwaptionBermudaFixedIbor(expirySwap, _isLong, expiryTime, settleTime);
  }

  public  SwaptionBermudaFixedIborDefinition(final SwapFixedIborDefinition[] underlyingSwap, final boolean isLong, final ZonedDateTime[] expiryDate);

}