All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.opengamma.strata.calc.marketdata.MarketDataFunction Maven / Gradle / Ivy

Go to download

Provides the ability to run calculations, manage market data and create scenarios

There is a newer version: 2.12.44
Show newest version
/*
 * Copyright (C) 2015 - present by OpenGamma Inc. and the OpenGamma group of companies
 *
 * Please see distribution for license.
 */
package com.opengamma.strata.calc.marketdata;

import com.opengamma.strata.basics.ReferenceData;
import com.opengamma.strata.data.MarketDataId;
import com.opengamma.strata.data.scenario.MarketDataBox;
import com.opengamma.strata.data.scenario.ScenarioMarketData;

/**
 * A market data function creates items of market data for a set of market data IDs.
 * 

* A function implementation produces a single type of market data and consumes a single type of market data ID. * * @param the type of the market data built by this class * @param the type of the market data ID handled by this class */ public interface MarketDataFunction> { /** * Returns requirements representing the data needed to build the item of market data identified by the ID. * * @param id an ID identifying an item of market data * @param marketDataConfig configuration specifying how market data values should be built * @return requirements representing the data needed to build the item of market data identified by the ID */ public abstract MarketDataRequirements requirements(I id, MarketDataConfig marketDataConfig); /** * Builds and returns the market data identified by the ID. *

* If the data cannot be built the result contains details of the problem. * * @param id ID of the market data that should be built * @param marketDataConfig configuration specifying how the market data should be built * @param marketData a set of market data including any data required to build the requested data * @param refData the reference data * @return built market data, or details of the problems that prevented building */ public abstract MarketDataBox build( I id, MarketDataConfig marketDataConfig, ScenarioMarketData marketData, ReferenceData refData); /** * Returns the type of market data ID this function can handle. * * @return the type of market data ID this function can handle */ public abstract Class getMarketDataIdType(); }