class DayPeriodPreCalculatedDiscountCurve extends DiscountCurve {

  @Override
  public double getDiscountFactor(final double t) {
    if (_preCalculatedDiscountFactors == null) {
      return super.getDiscountFactor(t);
    }
    final long nDaysLong = Math.round(t * _daysPerYear);
    if (nDaysLong > Integer.MAX_VALUE) {
      return super.getDiscountFactor(t);
    }
    final int nDays = (int) nDaysLong;
    if (nDays > _preCalculatedDiscountFactors.length) {
      return super.getDiscountFactor(t);
    }
    return _preCalculatedDiscountFactors[nDays];
  }

  public  DayPeriodPreCalculatedDiscountCurve(final String name, final DoublesCurve discountFactorCurve);
  public  DayPeriodPreCalculatedDiscountCurve(final String name, final DoublesCurve discountFactorCurve, final double daysPerYear);

}