class UniformMeshing extends MeshingFunction {

  @Override
  public Double evaluate(Integer x) {
    if (x < 0 || x >= getNumberOfPoints()) {
      throw new IllegalArgumentException("index out of range");
    }

    if (x == 0) {
      return 0.0;
    }
    if (x == getNumberOfPoints() - 1) {
      return 1.0;
    }

    if (_db == null) {
      return ((double) x) / (getNumberOfPoints() - 1);
    }

    // avoid interpolator lookup if requested value is a fixed value
    final int index = getFixedPointIndex(x);
    if (index >= 0) {
      return _fpValues[index];
    }

    return INTERPOLATOR.interpolate(_db, (double) x);
  }

  public  UniformMeshing(int nPoints);
  public  UniformMeshing(int nPoints, final double[] fixedPoints);

}