class Interpolator1DDoubleQuadraticDataBundle implements Interpolator1DDataBundle, Serializable {

  @Override
  public void setYValueAtIndex(final int index, final double y) {
    ArgumentChecker.notNegative(index, "index");
    if (index >= size()) {
      throw new IllegalArgumentException("Index was greater than number of data points");
    }
    _underlyingData.setYValueAtIndex(index, y);
    if (_quadratics == null) {
      _quadratics = getQuadratics();
    }
    final double[] keys = getKeys();
    final double[] values = getValues();
    final int n = size() - 1;
    if (index == 0) {
      _quadratics[0] = getQuadratic(keys, values, 1);
      return;
    } else if (index == 1) {
      _quadratics[0] = getQuadratic(keys, values, 1);
      _quadratics[1] = getQuadratic(keys, values, 2);
      return;
    } else if (index == n) {
      _quadratics[n - 2] = getQuadratic(keys, values, n - 1);
    } else if (index == n - 1) {
      _quadratics[n - 3] = getQuadratic(keys, values, n - 2);
      _quadratics[n - 2] = getQuadratic(keys, values, n - 1);
      return;
    } else {
      _quadratics[index - 2] = getQuadratic(keys, values, index - 1);
      _quadratics[index - 1] = getQuadratic(keys, values, index);
      _quadratics[index] = getQuadratic(keys, values, index + 1);
      return;
    }
  }

  public  Interpolator1DDoubleQuadraticDataBundle(final Interpolator1DDataBundle underlyingData);

}