SurfaceShiftFunctionFactory { public static SurfaceShiftFunction<?> getFunction(final Class<?> clazz) { final SurfaceShiftFunction<?> f = s_instances.get(clazz); if (f == null) { throw new IllegalArgumentException("Could not get function for " + clazz.getName()); } return f; }  static SurfaceShiftFunction<?> getFunction(final Class<?> clazz); static Surface<Double, Double, Double> getShiftedSurface(final Surface<Double, Double, Double> surface, final double shift, final boolean useAdditive); static Surface<Double, Double, Double> getShiftedSurface(final Surface<Double, Double, Double> surface, final double x, final double y, final double shift,
      final boolean useAdditive); static Surface<Double, Double, Double> getShiftedSurface(final Surface<Double, Double, Double> surface, final double[] x, final double[] y,
      final double[] shift, final boolean useAdditive); static Surface<Double, Double, Double> getShiftedSurface(final Surface<Double, Double, Double> surface, final double shift, final String newName,
      final boolean useAdditive); static Surface<Double, Double, Double> getShiftedSurface(final Surface<Double, Double, Double> surface, final double x, final double y, final double shift,
      final String newName, final boolean useAdditive); static Surface<Double, Double, Double> getShiftedSurface(final Surface<Double, Double, Double> surface, final double[] x, final double[] y,
      final double[] shift, final String newName, final boolean useAdditive); static final ConstantSurfaceAdditiveShiftFunction CONSTANT_ADDITIVE; static final ConstantSurfaceMultiplicativeShiftFunction CONSTANT_MULTIPLICATIVE; static final FunctionalSurfaceAdditiveShiftFunction FUNCTIONAL_ADDITIVE; static final FunctionalSurfaceMultiplicativeShiftFunction FUNCTIONAL_MULTIPLICATIVE; static final InterpolatedSurfaceAdditiveShiftFunction INTERPOLATED_ADDITIVE; static final InterpolatedSurfaceMultiplicativeShiftFunction INTERPOLATED_MULTIPLICATIVE; static final InterpolatedFromCurvesSurfaceAdditiveShiftFunction INTERPOLATED_FROM_CURVES_ADDITIVE; static final NodalSurfaceAdditiveShiftFunction NODAL_ADDITIVE; static final NodalSurfaceMultiplicativeShiftFunction NODAL_MULTIPLICATIVE; }
@Test(expectedExceptions = IllegalArgumentException.class) public void testWrongClass() { SurfaceShiftFunctionFactory.getFunction(Double.class); }
@Test public void testGetFunction() { assertEquals(ConstantSurfaceAdditiveShiftFunction.class, getFunction(ConstantSurfaceAdditiveShiftFunction.class).getClass()); assertEquals(FunctionalSurfaceAdditiveShiftFunction.class, getFunction(FunctionalSurfaceAdditiveShiftFunction.class).getClass()); assertEquals(InterpolatedSurfaceAdditiveShiftFunction.class, getFunction(InterpolatedSurfaceAdditiveShiftFunction.class).getClass()); assertEquals(InterpolatedFromCurvesSurfaceAdditiveShiftFunction.class, getFunction(InterpolatedFromCurvesSurfaceAdditiveShiftFunction.class).getClass()); assertEquals(NodalSurfaceAdditiveShiftFunction.class, getFunction(NodalSurfaceAdditiveShiftFunction.class).getClass()); assertEquals(ConstantSurfaceMultiplicativeShiftFunction.class, getFunction(ConstantSurfaceMultiplicativeShiftFunction.class).getClass()); assertEquals(FunctionalSurfaceMultiplicativeShiftFunction.class, getFunction(FunctionalSurfaceMultiplicativeShiftFunction.class).getClass()); assertEquals(InterpolatedSurfaceMultiplicativeShiftFunction.class, getFunction(InterpolatedSurfaceMultiplicativeShiftFunction.class).getClass()); assertEquals(NodalSurfaceMultiplicativeShiftFunction.class, getFunction(NodalSurfaceMultiplicativeShiftFunction.class).getClass()); }