paymentDayCounter, start, end, refStart, refEnd));
}
else if (Detail.noOption(caps, floors, i)) {
// get the generic type
final Class<?> fctklass = new TypeTokenTree(this.getClass()).getElement(1);
// construct a new instance using reflection. first get the
// constructor ...
FloatingCouponType frc;
try {
frc = (FloatingCouponType) fctklass.getConstructor(
Date.class, // paymentdate
double.class, // nominal
Date.class, // start date
Date.class, // enddate
int.class, // fixing days
index.getClass(), // ii
double.class, // gearing
double.class, // spread
Date.class, // refperiodstart
Date.class, // refperiodend
DayCounter.class,// daycounter
boolean.class) // inarrears
// then create a new instance
.newInstance(
paymentDate,
Detail.get(nominals, i, 1.0),
start,
end,
(int) Detail.get(fixingDays, i, index
.fixingDays()), index,
Detail.get(gearings, i, 1.0),
Detail.get(spreads, i, 0.0), refStart,
refEnd, paymentDayCounter, isInArrears);
} catch (final Exception e) {
throw new LibraryException(
"Couldn't construct new instance from generic type"); // QA:[RG]::verified
// //
// TODO:
// message
}
// append coupon cashflow
add(frc);
}
else {
final Class<?> cfcklass = new TypeTokenTree(this.getClass()).getElement(2);
CappedFlooredCouponType cfctc;
try {
final CappedFlooredIborCoupon cpn = new CappedFlooredIborCoupon(
paymentDate,
Detail.get(nominals,i, 1.0),