}
// Derivatives
final CouponDefinition cpn0 = getNthPayment(0);
if (!date.isAfter(cpn0.getPaymentDate())) {
if (isFixed[0]) {
cpnList.add(new CouponFixed(getCurrency(), TimeCalculator.getTimeBetween(date, cpn0.getPaymentDate()), yieldCurveNames[0], cpn0.getPaymentYearFraction(), cpn0.getNotional(), fixedCpn.get(0),
cpn0.getAccrualStartDate(), cpn0.getAccrualEndDate()));
} else { // CouponIborGearingDefinition
cpnList.add(((CouponIborGearingDefinition) cpn0).toDerivative(date, yieldCurveNames));
}
}
for (int loopcpn = 1; loopcpn < getNumberOfPayments(); loopcpn++) {
final CouponDefinition cpn = getNthPayment(loopcpn);
if (!date.isAfter(getNthPayment(loopcpn).getPaymentDate())) {
if (isFixed[loopcpn]) {
cpnList.add(new CouponFixed(getCurrency(), TimeCalculator.getTimeBetween(date, cpn.getPaymentDate()), yieldCurveNames[0], cpn.getPaymentYearFraction(), cpn.getNotional(), fixedCpn
.get(loopcpn), cpn.getAccrualStartDate(), cpn.getAccrualEndDate()));
} else {
cpnList.add(((CouponIborRatchetDefinition) cpn).toDerivative(date, yieldCurveNames));
}
}