@Override
public PriceIndexCurve generateCurve(String name, InflationProviderInterface inflation, double[] parameters) {
if (inflation instanceof InflationProviderDiscount) { // TODO: improve the way the curves are generated
PriceIndexCurve existingCurve = ((InflationProviderDiscount) inflation).getCurve(_existingCurveName);
PriceIndexCurve newCurve = _generator.generateCurve(name + "-0", inflation, parameters);
return new PriceIndexCurveAddPriceIndexSpreadCurve(name, _substract, existingCurve, newCurve);
}
throw new UnsupportedOperationException("Cannot generate curves for a GeneratorCurveAddYieldExisiting");
}