class DayPeriodPreCalculatedDiscountCurve extends DiscountCurve {

  public void preCalculateDiscountFactors(final int numYears) {
    ArgumentChecker.isTrue(numYears >= 1, "numYears must be more than 1");
    // Because of leap year and other calendar issues, we can't actually
    // accurately pre-calculate the number of forward days over that number
    // of years. Therefore, we overallocate the array and go beyond the end
    // of the year range slightly.

    _preCalculatedDiscountFactors = new double[numYears * 366];
    int numDays = 0;
    while (numDays < _preCalculatedDiscountFactors.length) {
      final double xValue = (numDays) / _daysPerYear;
      final double yValue = super.getDiscountFactor(xValue);
      _preCalculatedDiscountFactors[numDays] = yValue;
      numDays++;
    }
  }

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

}