/**
 * Calculates the present value of an inflation instruments by discounting for a given MarketBundle
 */
public final class CurrencyExposureForexBlackFlatCalculator
    extends InstrumentDerivativeVisitorSameMethodAdapter<
        BlackForexFlatProviderInterface, MultipleCurrencyAmount> {

  /** The unique instance of the calculator. */
  private static final CurrencyExposureForexBlackFlatCalculator INSTANCE =
      new CurrencyExposureForexBlackFlatCalculator();

  /** Constructor. */
  private CurrencyExposureForexBlackFlatCalculator() {}

  /**
   * Gets the calculator instance.
   *
   * @return The calculator.
   */
  public static CurrencyExposureForexBlackFlatCalculator getInstance() {
    return INSTANCE;
  }

  /** Pricing methods. */
  private static final ForexOptionVanillaBlackFlatMethod METHOD_FX_VAN =
      ForexOptionVanillaBlackFlatMethod.getInstance();

  @Override
  public MultipleCurrencyAmount visit(
      final InstrumentDerivative derivative, final BlackForexFlatProviderInterface blackSmile) {
    return derivative.accept(this, blackSmile);
  }

  // -----     Forex     ------

  @Override
  public MultipleCurrencyAmount visitForexOptionVanilla(
      final ForexOptionVanilla option, final BlackForexFlatProviderInterface blackSmile) {
    return METHOD_FX_VAN.currencyExposure(option, blackSmile);
  }

  @Override
  public MultipleCurrencyAmount visit(final InstrumentDerivative derivative) {
    throw new UnsupportedOperationException();
  }
}
 @Override
 public MultipleCurrencyAmount visitForexOptionVanilla(
     final ForexOptionVanilla option, final BlackForexFlatProviderInterface blackSmile) {
   return METHOD_FX_VAN.currencyExposure(option, blackSmile);
 }