/** * Copyright (C) 2011 - present by OpenGamma Inc. and the OpenGamma group of companies * * Please see distribution for license. */ package com.opengamma.analytics.financial.forex.calculator; import com.opengamma.analytics.financial.forex.derivative.ForexOptionDigital; import com.opengamma.analytics.financial.forex.derivative.ForexOptionSingleBarrier; import com.opengamma.analytics.financial.forex.derivative.ForexOptionVanilla; import com.opengamma.analytics.financial.forex.method.ForexOptionDigitalBlackMethod; import com.opengamma.analytics.financial.forex.method.ForexOptionSingleBarrierBlackMethod; import com.opengamma.analytics.financial.forex.method.ForexOptionVanillaBlackSmileMethod; import com.opengamma.analytics.financial.interestrate.InstrumentDerivativeVisitorAdapter; import com.opengamma.analytics.financial.interestrate.YieldCurveBundle; /** * Calculator of the implied volatility for Forex derivatives in the Black (Garman-Kohlhagen) world. * @deprecated Curve builders that use and populate {@link YieldCurveBundle}s are deprecated. */ @Deprecated public class ImpliedVolatilityBlackForexCalculator extends InstrumentDerivativeVisitorAdapter<YieldCurveBundle, Double> { /** * The unique instance of the calculator. */ private static final ImpliedVolatilityBlackForexCalculator INSTANCE = new ImpliedVolatilityBlackForexCalculator(); /** * Gets the calculator instance. * @return The calculator. */ public static ImpliedVolatilityBlackForexCalculator getInstance() { return INSTANCE; } /** * Constructor. */ ImpliedVolatilityBlackForexCalculator() { } /** Vanilla option calculator */ private static final ForexOptionVanillaBlackSmileMethod METHOD_FXOPTIONVANILLA = ForexOptionVanillaBlackSmileMethod.getInstance(); /** Digital option calculator */ private static final ForexOptionDigitalBlackMethod METHOD_FXDIGITAL = ForexOptionDigitalBlackMethod.getInstance(); /** Single barrier option calculator */ private static final ForexOptionSingleBarrierBlackMethod METHOD_FXBARRIER = ForexOptionSingleBarrierBlackMethod.getInstance(); @Override public Double visitForexOptionVanilla(final ForexOptionVanilla derivative, final YieldCurveBundle data) { return METHOD_FXOPTIONVANILLA.impliedVolatility(derivative, data); } @Override public Double visitForexOptionDigital(final ForexOptionDigital derivative, final YieldCurveBundle data) { return METHOD_FXDIGITAL.impliedVolatility(derivative, data); } @Override public Double visitForexOptionSingleBarrier(final ForexOptionSingleBarrier derivative, final YieldCurveBundle data) { return METHOD_FXBARRIER.impliedVolatility(derivative, data); } }