/** * Copyright (C) 2015 - present by OpenGamma Inc. and the OpenGamma group of companies * * Please see distribution for license. */ package com.opengamma.analytics.financial.provider.calculator.normalstirfutures; import com.opengamma.analytics.financial.interestrate.InstrumentDerivativeVisitorAdapter; import com.opengamma.analytics.financial.interestrate.future.derivative.InterestRateFutureOptionMarginTransaction; import com.opengamma.analytics.financial.interestrate.future.provider.InterestRateFutureOptionMarginTransactionNormalSmileMethod; import com.opengamma.analytics.financial.provider.description.interestrate.NormalSTIRFuturesProviderInterface; /** * Calculates the present value theta (first derivative of the present value with respect to the time) for interest rate * future options. */ public final class PositionThetaNormalSTIRFutureOptionCalculator extends InstrumentDerivativeVisitorAdapter<NormalSTIRFuturesProviderInterface, Double> { /** * The unique instance of the calculator. */ private static final PositionThetaNormalSTIRFutureOptionCalculator INSTANCE = new PositionThetaNormalSTIRFutureOptionCalculator(); /** * Gets the calculator instance. * @return The calculator. */ public static PositionThetaNormalSTIRFutureOptionCalculator getInstance() { return INSTANCE; } /** * Constructor. */ private PositionThetaNormalSTIRFutureOptionCalculator() { } /** * Pricing methods. */ private static final InterestRateFutureOptionMarginTransactionNormalSmileMethod METHOD_STIR = InterestRateFutureOptionMarginTransactionNormalSmileMethod .getInstance(); @Override public Double visitInterestRateFutureOptionMarginTransaction(InterestRateFutureOptionMarginTransaction futures, NormalSTIRFuturesProviderInterface normal) { return METHOD_STIR.presentValueTheta(futures, normal); } }