class Interpolator1DFactory {

  public static String getInterpolatorName(final Interpolator1D interpolator) {
    if (interpolator == null) {
      return null;
    }
    final String interpolatorName = s_instanceNames.get(interpolator.getClass());
    // TODO kirk 2010-03-31 -- Deal with the more complicated rules for
    // Barycentric, Polynomial, and RationalFunction.
    if (interpolator instanceof LinearExtrapolator1D) {
      return LINEAR_EXTRAPOLATOR;
    }
    if (interpolator instanceof LogLinearExtrapolator1D) {
      return LOG_LINEAR_EXTRAPOLATOR;
    }
    if (interpolator instanceof QuadraticPolynomialLeftExtrapolator) {
      return QUADRATIC_LEFT_EXTRAPOLATOR;
    }
    if (interpolator instanceof ReciprocalExtrapolator1D) {
      return RECIPROCAL_EXTRAPOLATOR;
    }
    if (interpolator instanceof ProductPolynomialExtrapolator1D) {
      return PRODUCT_POLYNOMIAL_EXTRAPOLATOR;
    }
    return interpolatorName;
  }

  private  Interpolator1DFactory();

}