/** * Checks if this info contains the specified curve. * * @param name the curve to find * @return true if the curve is matched */ public boolean containsCurve(CurveName name) { return order.stream().anyMatch(o -> o.getName().equals(name)); }
@Override public <T> Optional<T> findData(MarketDataName<T> name) { if (curve.getName().equals(name)) { return Optional.of(name.getMarketDataType().cast(curve)); } return Optional.empty(); }
@Override public <T> Optional<T> findData(MarketDataName<T> name) { if (curve.getName().equals(name)) { return Optional.of(name.getMarketDataType().cast(curve)); } return Optional.empty(); }
@Override public <T> Optional<T> findData(MarketDataName<T> name) { if (curve.getName().equals(name)) { return Optional.of(name.getMarketDataType().cast(curve)); } return Optional.empty(); }
@Override public <T> Optional<T> findData(MarketDataName<T> name) { if (curve.getName().equals(name)) { return Optional.of(name.getMarketDataType().cast(curve)); } return Optional.empty(); }
@Override public <T> Optional<T> findData(MarketDataName<T> name) { if (curve.getName().equals(name)) { return Optional.of(name.getMarketDataType().cast(curve)); } return Optional.empty(); }
@Override public <T> Optional<T> findData(MarketDataName<T> name) { if (curve.getName().equals(name)) { return Optional.of(name.getMarketDataType().cast(curve)); } return Optional.empty(); }
@Override public <T> Optional<T> findData(MarketDataName<T> name) { if (curve.getName().equals(name)) { return Optional.of(name.getMarketDataType().cast(curve)); } return Optional.empty(); }
@Override public <T> Optional<T> findData(MarketDataName<T> name) { if (name instanceof CurveName) { return Stream.concat(discountCurves.values().stream(), indexCurves.values().stream()) .filter(c -> c.getName().equals(name)) .map(v -> name.getMarketDataType().cast(v)) .findFirst(); } return Optional.empty(); }
/** * Finds the curve with the specified name. * <p> * If the curve cannot be found, empty is returned. * * @param name the curve name * @return the curve, empty if not found */ @Override public Optional<Curve> findCurve(CurveName name) { return Stream.concat(discountCurves.values().stream(), forwardCurves.values().stream()) .filter(c -> c.getName().equals(name)) .findFirst(); }
/** * Finds the curve with the specified name. * <p> * If the curve cannot be found, empty is returned. * * @param name the curve name * @return the curve, empty if not found */ @Override public Optional<Curve> findCurve(CurveName name) { return Stream.concat(repoCurves.values().stream(), issuerCurves.values().stream()) .filter(c -> c.getName().equals(name)) .findFirst(); }
@Override public <T> Optional<T> findData(MarketDataName<T> name) { if (surface.getName().equals(name)) { return Optional.of(name.getMarketDataType().cast(surface)); } if (shiftCurve.getName().equals(name)) { return Optional.of(name.getMarketDataType().cast(shiftCurve)); } return Optional.empty(); }
@Override public <T> Optional<T> findData(MarketDataName<T> name) { if (parameters.getAlphaCurve().getName().equals(name)) { return Optional.of(name.getMarketDataType().cast(parameters.getAlphaCurve())); } if (parameters.getBetaCurve().getName().equals(name)) { return Optional.of(name.getMarketDataType().cast(parameters.getBetaCurve())); } if (parameters.getRhoCurve().getName().equals(name)) { return Optional.of(name.getMarketDataType().cast(parameters.getRhoCurve())); } if (parameters.getNuCurve().getName().equals(name)) { return Optional.of(name.getMarketDataType().cast(parameters.getNuCurve())); } if (parameters.getShiftCurve().getName().equals(name)) { return Optional.of(name.getMarketDataType().cast(parameters.getShiftCurve())); } return Optional.empty(); }
/** * Merges the specified entry with this entry, returning a new entry. * <p> * The two entries must have the same curve name. * * @param newEntry the new entry * @return the merged entry */ RatesCurveGroupEntry merge(RatesCurveGroupEntry newEntry) { if (!curveName.equals(newEntry.curveName)) { throw new IllegalArgumentException( Messages.format( "A CurveGroupEntry can only be merged with an entry with the same curve name. name: {}, other name: {}", curveName, newEntry.curveName)); } return RatesCurveGroupEntry.builder() .curveName(curveName) .discountCurrencies(Sets.union(discountCurrencies, newEntry.discountCurrencies)) .indices(Sets.union(indices, newEntry.indices)) .build(); }
if (order.get(0).getName().equals(EUR_DSCON_OIS)) { trades.addAll(tradesDsc); trades.addAll(tradesE3); assertEquals(jiComputed.columnCount(), jiExpectedDsc.columnCount()); assertEquals(jiComputed.columnCount(), jiExpectedE3.columnCount()); int shiftDsc = order.get(0).getName().equals(EUR_DSCON_OIS) ? 0 : jiExpectedE3.rowCount(); for (int i = 0; i < jiExpectedDsc.rowCount(); i++) { for (int j = 0; j < jiExpectedDsc.columnCount(); j++) { int shiftE3 = order.get(0).getName().equals(EUR_DSCON_OIS) ? jiExpectedDsc.rowCount() : 0; for (int i = 0; i < jiExpectedE3.rowCount(); i++) { for (int j = 0; j < jiExpectedDsc.columnCount(); j++) {