}
return FORMATTING_ERROR;
}
private List<Double[]> formatExpanded(DoublesCurve value) {
NodalDoublesCurve detailedCurve;
if (value instanceof NodalDoublesCurve) {
detailedCurve = (NodalDoublesCurve) value;
} else if (value instanceof InterpolatedDoublesCurve) {
InterpolatedDoublesCurve interpolatedCurve = (InterpolatedDoublesCurve) value;
detailedCurve = NodalDoublesCurve.from(interpolatedCurve.getXDataAsPrimitive(), interpolatedCurve.getYDataAsPrimitive());
} else {
throw new OpenGammaRuntimeException("Cannot handle curves of type " + value.getClass());
}
List<Double[]> detailedData = new ArrayList<>();
Double[] xs = detailedCurve.getXData();
Double[] ys = detailedCurve.getYData();
for (int i = 0; i < ys.length; i++) {
detailedData.add(new Double[]{xs[i], ys[i]});
}
return detailedData;
}