final String fullDefinitionName = definitionName + "_" + currency.getCode();
final SwaptionVolatilityCubeSpecification specification = specificationSource.getSpecification(fullSpecificationName);
if (specification == null) {
throw new OpenGammaRuntimeException("Could not get swaption volatility cube specification named " + fullSpecificationName);
}
final VolatilityCubeDefinition definition = definitionSource.getDefinition(currency, fullDefinitionName);
if (definition == null) {
throw new OpenGammaRuntimeException("Could not get swaption volatility cube definition named " + fullDefinitionName);
}
final CubeInstrumentProvider<Tenor, Tenor, Double> provider = (CubeInstrumentProvider<Tenor, Tenor, Double>) specification.getCubeInstrumentProvider();
final Map<VolatilityPoint, Double> data = new HashMap<VolatilityPoint, Double>();
final Map<VolatilityPoint, ExternalIdBundle> ids = new HashMap<VolatilityPoint, ExternalIdBundle>();
for (final Tenor x : definition.getSwapTenors()) {
for (final Tenor y : definition.getOptionExpiries()) {
for (final Double z : definition.getRelativeStrikes()) {
final ExternalId id = provider.getInstrument(x, y, z);
final ValueRequirement requirement = new ValueRequirement(provider.getDataFieldName(), ComputationTargetType.PRIMITIVE, id);
final Object volatilityObject = inputs.getValue(requirement);
if (volatilityObject != null) {
final Double volatility = (Double) volatilityObject;