/** * Copyright (C) 2012 - present by OpenGamma Inc. and the OpenGamma group of companies * * Please see distribution for license. */ package com.opengamma.financial.analytics.model.forex.option.black; import com.opengamma.engine.ComputationTarget; import com.opengamma.engine.value.ValueProperties; import com.opengamma.engine.value.ValuePropertyNames; import com.opengamma.engine.value.ValueRequirement; import com.opengamma.financial.analytics.model.CalculationPropertyNamesAndValues; import com.opengamma.financial.analytics.model.InterpolatedDataProperties; import com.opengamma.financial.analytics.model.black.BlackDiscountingFXOptionFunction; import com.opengamma.financial.currency.CurrencyPair; /** * Base class for FX option functions that use the Black method. The results do * not set the {@link ValuePropertyNames#CURRENCY} property. * @deprecated Use classes that descend from {@link BlackDiscountingFXOptionFunction} */ @Deprecated public abstract class FXOptionBlackMultiValuedFunction extends FXOptionBlackFunction { public FXOptionBlackMultiValuedFunction(final String valueRequirementName) { super(valueRequirementName); } @Override protected ValueProperties.Builder getResultProperties(final ComputationTarget target) { return createValueProperties() .with(ValuePropertyNames.CALCULATION_METHOD, CalculationPropertyNamesAndValues.BLACK_METHOD) .withAny(PUT_CURVE) .withAny(PUT_CURVE_CALC_CONFIG) .withAny(CALL_CURVE) .withAny(CALL_CURVE_CALC_CONFIG) .withAny(ValuePropertyNames.SURFACE) .withAny(InterpolatedDataProperties.X_INTERPOLATOR_NAME) .withAny(InterpolatedDataProperties.LEFT_X_EXTRAPOLATOR_NAME) .withAny(InterpolatedDataProperties.RIGHT_X_EXTRAPOLATOR_NAME); } @Override protected ValueProperties.Builder getResultProperties(final ComputationTarget target, final String putCurve, final String putCurveCalculationConfig, final String callCurve, final String callCurveCalculationConfig, final CurrencyPair baseQuotePair, final ValueProperties optionalProperties) { return createValueProperties() .with(ValuePropertyNames.CALCULATION_METHOD, CalculationPropertyNamesAndValues.BLACK_METHOD) .with(PUT_CURVE, putCurve) .with(PUT_CURVE_CALC_CONFIG, putCurveCalculationConfig) .with(CALL_CURVE, callCurve) .with(CALL_CURVE_CALC_CONFIG, callCurveCalculationConfig) .withAny(ValuePropertyNames.SURFACE) .withAny(InterpolatedDataProperties.X_INTERPOLATOR_NAME) .withAny(InterpolatedDataProperties.LEFT_X_EXTRAPOLATOR_NAME) .withAny(InterpolatedDataProperties.RIGHT_X_EXTRAPOLATOR_NAME); } @Override protected ValueProperties.Builder getResultProperties(final ComputationTarget target, final ValueRequirement desiredValue, final CurrencyPair baseQuotePair) { final String putCurveName = desiredValue.getConstraint(PUT_CURVE); final String callCurveName = desiredValue.getConstraint(CALL_CURVE); final String putCurveConfig = desiredValue.getConstraint(PUT_CURVE_CALC_CONFIG); final String callCurveConfig = desiredValue.getConstraint(CALL_CURVE_CALC_CONFIG); final String surfaceName = desiredValue.getConstraint(ValuePropertyNames.SURFACE); final String interpolatorName = desiredValue.getConstraint(InterpolatedDataProperties.X_INTERPOLATOR_NAME); final String leftExtrapolatorName = desiredValue.getConstraint(InterpolatedDataProperties.LEFT_X_EXTRAPOLATOR_NAME); final String rightExtrapolatorName = desiredValue.getConstraint(InterpolatedDataProperties.RIGHT_X_EXTRAPOLATOR_NAME); return createValueProperties() .with(ValuePropertyNames.CALCULATION_METHOD, CalculationPropertyNamesAndValues.BLACK_METHOD) .with(PUT_CURVE, putCurveName) .with(PUT_CURVE_CALC_CONFIG, putCurveConfig) .with(CALL_CURVE, callCurveName) .with(CALL_CURVE_CALC_CONFIG, callCurveConfig) .with(ValuePropertyNames.SURFACE, surfaceName) .with(InterpolatedDataProperties.X_INTERPOLATOR_NAME, interpolatorName) .with(InterpolatedDataProperties.LEFT_X_EXTRAPOLATOR_NAME, leftExtrapolatorName) .with(InterpolatedDataProperties.RIGHT_X_EXTRAPOLATOR_NAME, rightExtrapolatorName); } }