YieldSimpleCurve extends YieldAndDiscountCurve { @Override public double getDiscountFactor(final double t) { return 1.0d / (1.0d + t * _curve.getYValue(t)); } YieldSimpleCurve(String name, DoublesCurve curve); @Override double getDiscountFactor(final double t); @Override double getInterestRate(Double x); @Override double getForwardRate(double t); @Override double[] getInterestRateParameterSensitivity(double time); @Override int getNumberOfParameters(); @Override List<String> getUnderlyingCurvesNames(); DoublesCurve getCurve(); @Override int hashCode(); @Override boolean equals(final Object obj);  }
@Test public void discountFactor() { for (int loopt = 0; loopt < NB_TEST; loopt++) { double r = RATE.getYValue(TIME_TEST[loopt]); double df = 1.0d / (1.0d + TIME_TEST[loopt] * r); assertEquals("YieldSimpleCurve: discount factor", df, CURVE.getDiscountFactor(TIME_TEST[loopt]), TOLERANCE_RATE); } }