assert(freq!=Frequency.NoFrequency && freq != Frequency.Once):"invalid frequency:" + freq.toString();
final Handle<Quote> zSpreadQuoteHandle = new Handle<Quote>(new SimpleQuote(
zSpread));
final ZeroSpreadedTermStructure spreadedCurve = new ZeroSpreadedTermStructure(
discountCurve, zSpreadQuoteHandle, comp, freq, dc);
/* @Real */double price = 0.0;
for (int i = 0; i < cashflows.size(); ++i) {
if (cashflows.get(i).hasOccurred(settlement)) {
continue;
}
final Date couponDate = cashflows.get(i).date();
/* @Real */final double amount = cashflows.get(i).amount();
price += amount * spreadedCurve.discount(couponDate);
}
price /= spreadedCurve.discount(settlement);
return price / faceAmount * 100.0;
}