return new VolatilityCubeKey(currency, cube);
}
@Override
VolatilityCubeSnapshot buildSnapshot(ViewComputationResultModel resultModel, VolatilityCubeKey key, VolatilityCubeData volatilityCubeData) {
ManageableVolatilityCubeSnapshot ret = new ManageableVolatilityCubeSnapshot();
ManageableUnstructuredMarketDataSnapshot otherValues = getUnstructured(volatilityCubeData.getOtherData());
Map<VolatilityPoint, ValueSnapshot> values = new HashMap<VolatilityPoint, ValueSnapshot>();
//fill with nulls
VolatilityCubeDefinition definition = _cubeDefinitionSource.getDefinition(key.getCurrency(), key.getName());
Iterable<VolatilityPoint> allPoints = definition.getAllPoints();
for (VolatilityPoint point : allPoints) {
values.put(point, new ValueSnapshot(null));
}
for (Entry<VolatilityPoint, Double> ycp : volatilityCubeData.getDataPoints().entrySet()) {
values.put(ycp.getKey(), new ValueSnapshot(ycp.getValue()));
}
Map<Pair<Tenor, Tenor>, ValueSnapshot> strikes = new HashMap<Pair<Tenor, Tenor>, ValueSnapshot>();
for (Entry<Pair<Tenor, Tenor>, Double> strike : volatilityCubeData.getATMStrikes().entrySet()) {
strikes.put(strike.getKey(), new ValueSnapshot(strike.getValue()));
}
ret.setOtherValues(otherValues);
ret.setValues(values);
ret.setStrikes(strikes);
return ret;
}