/**
 * Copyright (C) 2015 - present by OpenGamma Inc. and the OpenGamma group of companies
 *
 * Please see distribution for license.
 */
package com.opengamma.strata.engine.marketdata;

import java.time.LocalDate;

import com.opengamma.strata.basics.market.MarketDataKey;
import com.opengamma.strata.basics.market.ObservableKey;
import com.opengamma.strata.collect.timeseries.LocalDateDoubleTimeSeries;
import com.opengamma.strata.engine.config.MarketDataRules;

/**
 * A source of market data provided to an engine function and used for a calculation across a single scenario.
 * <p>
 * The set of data provided by this interface is a subset of the set provided by {@link ScenarioMarketData}.
 * For example a function might request a USD discounting curve, but the scenario market data can contain
 * multiple curve groups, each with a USD discounting curve.
 * <p>
 * Typically a set of {@link MarketDataRules} are used to choose the item of market data from the global set.
 */
public interface SingleCalculationMarketData {

  /**
   * @return the valuation dates of the calculation
   */
  public abstract LocalDate getValuationDate();

  /**
   * Returns a list of market data values, one from each scenario.
   * <p>
   * The date of the market data is the same as the valuation date of the scenario.
   *
   * @param key  key identifying the market data
   * @param <T>  type of the market data
   * @param <K>  type of the market data key
   * @return a list of market data values, one from each scenario
   */
  public abstract <T, K extends MarketDataKey<T>> T getValue(K key);

  /**
   * Returns a list of market data time series, one from each scenario.
   *
   * @param key  key identifying the market data
   * @return a list of market data time series, one from each scenario
   */
  public abstract LocalDateDoubleTimeSeries getTimeSeries(ObservableKey key);
}

@@ -1026,24 +1026,168 @@
 ta %7B%0A%0A  /**%0A
+   * Gets the valuation date of the market data.%0A   * %3Cp%3E%0A   * All values accessible through this interface have the same valuation date.%0A   * %0A
    * @return
@@ -1296,33 +1296,27 @@
   * Returns 
-a list of
+the
  market data
@@ -1325,65 +1325,93 @@
 alue
-s, one from each scenario.%0A   * %3Cp%3E%0A   * The dat
+ identified by the specified key.%0A   * %3Cp%3E%0A   * The result will be a single piec
 e of 
-the 
 mark
@@ -1422,22 +1422,17 @@
 ata 
-is the same as
+valid for
  the
@@ -1450,24 +1450,77 @@
 date
- of the scenario
+.%0A   * The value will be for the scenario that this object represents
 .%0A  
@@ -1666,33 +1666,27 @@
   * @return 
-a list of
+the
  market data
@@ -1695,33 +1695,70 @@
 alue
-s, one from each scenario
+%0A   * @throws RuntimeException if the value cannot be returned
 %0A   
@@ -1853,65 +1853,55 @@
 rns 
-a list of market data time series, one from each scenario
+the time series identified by the specified key
 .%0A  
@@ -1969,65 +1969,91 @@
 urn 
-a list of market data
+the time series%0A   * @throws RuntimeException if the
  time
- 
+-
 series
-, one from each scenario
+ cannot be returned
 %0A   

Enhance engine Javadoc