@Override public DummyPointSensitivity withSensitivity(double sensitivity) { return new DummyPointSensitivity(curveCurrency, date, currency, sensitivity); }
public void test_equalWithTolerance_true() { PointSensitivity cs1b = DummyPointSensitivity.of(GBP, date(2015, 6, 30), 12.1d); PointSensitivities test1 = PointSensitivities.of(Lists.newArrayList(CS3, CS1)).normalized(); PointSensitivities test2 = PointSensitivities.of(Lists.newArrayList(CS3, cs1b)).normalized(); assertTrue(test1.equalWithTolerance(test2, 1.0E-1)); }
public void test_combinedWith() { PointSensitivityBuilder base = PointSensitivityBuilder.none(); PointSensitivityBuilder ibor = DummyPointSensitivity.of(GBP, date(2015, 6, 30), 2.0d); assertSame(base.combinedWith(ibor), ibor); // returns other }
/** * Obtains an instance from the curve currency, date and value. * <p> * The currency representing the curve is used also for the sensitivity currency. * * @param currency the currency of the curve and sensitivity * @param date the date that was looked up on the curve * @param sensitivity the value of the sensitivity * @return the point sensitivity object */ public static DummyPointSensitivity of(Currency currency, LocalDate date, double sensitivity) { return new DummyPointSensitivity(currency, date, currency, sensitivity); }
@Override public DummyPointSensitivity multipliedBy(double factor) { return new DummyPointSensitivity(curveCurrency, date, currency, sensitivity * factor); }
/** * Obtains an instance from the curve currency, date, sensitivity currency and value. * <p> * The currency representing the curve is used also for the sensitivity currency. * * @param curveCurrency the currency of the curve * @param date the date that was looked up on the curve * @param sensitivityCurrency the currency of the sensitivity * @param sensitivity the value of the sensitivity * @return the point sensitivity object */ public static DummyPointSensitivity of( Currency curveCurrency, LocalDate date, Currency sensitivityCurrency, double sensitivity) { return new DummyPointSensitivity(curveCurrency, date, sensitivityCurrency, sensitivity); }
@Override public DummyPointSensitivity withCurrency(Currency currency) { if (this.currency.equals(currency)) { return this; } return new DummyPointSensitivity(curveCurrency, date, currency, sensitivity); }
@Override public DummyPointSensitivity mapSensitivity(DoubleUnaryOperator operator) { return new DummyPointSensitivity(curveCurrency, date, currency, operator.applyAsDouble(sensitivity)); }