/** * Builds the market data. * * @return the market data */ public ImmutableScenarioMarketData build() { if (scenarioCount == -1) { scenarioCount = 1; } return new ImmutableScenarioMarketData(scenarioCount, valuationDate, values, timeSeries); }
@Override public ImmutableScenarioMarketData build() { return new ImmutableScenarioMarketData( scenarioCount, valuationDate, values, timeSeries); }
Map<ObservableId, LocalDateDoubleTimeSeries> timeSeries = new HashMap<>(other.timeSeries); timeSeries.putAll(this.timeSeries); return new ImmutableScenarioMarketData(mergedCount, valuationDate, values, timeSeries);
/** * Obtains an instance from a valuation date, map of values and time-series. * <p> * The valuation date and map of values must have the same number of scenarios. * * @param scenarioCount the number of scenarios * @param valuationDate the valuation dates associated with the market data, one for each scenario * @param values the market data values, one for each scenario * @param timeSeries the time-series * @return a set of market data containing the values in the map */ public static ImmutableScenarioMarketData of( int scenarioCount, MarketDataBox<LocalDate> valuationDate, Map<? extends MarketDataId<?>, MarketDataBox<?>> values, Map<? extends ObservableId, LocalDateDoubleTimeSeries> timeSeries) { MapStream.of(values).forEach((key, value) -> checkType(key, value, scenarioCount)); return new ImmutableScenarioMarketData(scenarioCount, valuationDate, values, timeSeries); }