this.notionalSchedule_ = new ArrayList<Date>();
this.notionals_ = new ArrayList<Double>();
this.redemptions_ = new Leg();
if (!cashflows.isEmpty()) {
notionalSchedule_.add(new Date());
notionals_.add(faceAmount);
notionalSchedule_.add(maturityDate);
notionals_.add(0.0);
final CashFlow last = cashflows.last();
redemptions_.add(last);
// sort cashflows, except last one
cashflows.remove(last);
Collections.sort(cashflows, new EarlierThanCashFlowComparator());
//now add last cashflow back to the last position
cashflows.add(last);
}
final Date evaluationDate = new Settings().evaluationDate();
evaluationDate.addObserver(this);
}