NodalDoublesSurface extends DoublesSurface { public static NodalDoublesSurface from(final double[] xData, final double[] yData, final double[] zData) { return new NodalDoublesSurface(xData, yData, zData); } NodalDoublesSurface(final double[] xData, final double[] yData, final double[] zData);  NodalDoublesSurface(final Double[] xData, final Double[] yData, final Double[] zData);  NodalDoublesSurface(final List<Double> xData, final List<Double> yData, final List<Double> zData);  NodalDoublesSurface(final DoublesPair[] xyData, final double[] zData);  NodalDoublesSurface(final DoublesPair[] xyData, final Double[] zData);  NodalDoublesSurface(final List<DoublesPair> xyData, final List<Double> zData);  NodalDoublesSurface(final Map<DoublesPair, Double> xyzData);  NodalDoublesSurface(final List<Triple<Double, Double, Double>> xyzData);  NodalDoublesSurface(final double[] xData, final double[] yData, final double[] zData, final String name);  NodalDoublesSurface(final Double[] xData, final Double[] yData, final Double[] zData, final String name);  NodalDoublesSurface(final List<Double> xData, final List<Double> yData, final List<Double> zData, final String name);  NodalDoublesSurface(final DoublesPair[] xyData, final double[] zData, final String name);  NodalDoublesSurface(final DoublesPair[] xyData, final Double[] zData, final String name);  NodalDoublesSurface(final List<DoublesPair> xyData, final List<Double> zData, final String name);  NodalDoublesSurface(final Map<DoublesPair, Double> xyzData, final String name);  NodalDoublesSurface(final List<Triple<Double, Double, Double>> xyzData, final String name); static NodalDoublesSurface from(final double[] xData, final double[] yData, final double[] zData); static NodalDoublesSurface from(final Double[] xData, final Double[] yData, final Double[] zData); static NodalDoublesSurface from(final List<Double> xData, final List<Double> yData, final List<Double> zData); static NodalDoublesSurface from(final DoublesPair[] xyData, final Double[] zData); static NodalDoublesSurface from(final DoublesPair[] xyData, final double[] zData); static NodalDoublesSurface from(final List<DoublesPair> xyData, final List<Double> zData); static NodalDoublesSurface from(final Map<DoublesPair, Double> data); static NodalDoublesSurface from(final List<Triple<Double, Double, Double>> xyzData); static NodalDoublesSurface from(final double[] xData, final double[] yData, final double[] zData, final String name); static NodalDoublesSurface from(final Double[] xData, final Double[] yData, final Double[] zData, final String name); static NodalDoublesSurface from(final List<Double> xData, final List<Double> yData, final List<Double> zData, final String name); static NodalDoublesSurface from(final DoublesPair[] xyData, final double[] zData, final String name); static NodalDoublesSurface from(final DoublesPair[] xyData, final Double[] zData, final String name); static NodalDoublesSurface from(final List<DoublesPair> xyData, final List<Double> zData, final String name); static NodalDoublesSurface from(final Map<DoublesPair, Double> xyzData, final String name); static NodalDoublesSurface from(final List<Triple<Double, Double, Double>> xyzData, final String name); @Override Double getZValue(final Double x, final Double y); @Override Double getZValue(final Pair<Double, Double> xy);  }
@Test public void testStaticConstruction() { NodalDoublesSurface surface = new NodalDoublesSurface(X_PRIMITIVE, Y_PRIMITIVE, Z_PRIMITIVE, NAME); NodalDoublesSurface other = NodalDoublesSurface.from(X_PRIMITIVE, Y_PRIMITIVE, Z_PRIMITIVE, NAME); assertEquals(surface, other); surface = new NodalDoublesSurface(X_OBJECT, Y_OBJECT, Z_OBJECT, NAME); other = NodalDoublesSurface.from(X_OBJECT, Y_OBJECT, Z_OBJECT, NAME); assertEquals(surface, other); surface = new NodalDoublesSurface(X_LIST, Y_LIST, Z_LIST, NAME); other = NodalDoublesSurface.from(X_LIST, Y_LIST, Z_LIST, NAME); assertEquals(surface, other); surface = new NodalDoublesSurface(XY_PAIR, Z_PRIMITIVE, NAME); other = NodalDoublesSurface.from(XY_PAIR, Z_PRIMITIVE, NAME); assertEquals(surface, other); surface = new NodalDoublesSurface(XY_PAIR, Z_OBJECT, NAME); other = NodalDoublesSurface.from(XY_PAIR, Z_OBJECT, NAME); assertEquals(surface, other); surface = new NodalDoublesSurface(XY_PAIR_LIST, Z_LIST, NAME); other = NodalDoublesSurface.from(XY_PAIR_LIST, Z_LIST, NAME); assertEquals(surface, other); surface = new NodalDoublesSurface(XYZ_MAP, NAME); other = NodalDoublesSurface.from(XYZ_MAP, NAME); assertEquals(surface, other); surface = new NodalDoublesSurface(XYZ_LIST, NAME); other = NodalDoublesSurface.from(XYZ_LIST, NAME); assertEquals(surface, other); surface = new NodalDoublesSurface(X_PRIMITIVE, Y_PRIMITIVE, Z_PRIMITIVE); other = NodalDoublesSurface.from(X_PRIMITIVE, Y_PRIMITIVE, Z_PRIMITIVE); assertFalse(other.equals(surface)); assertArrayEquals(surface.getXDataAsPrimitive(), other.getXDataAsPrimitive(), 0); assertArrayEquals(surface.getYDataAsPrimitive(), other.getYDataAsPrimitive(), 0); assertArrayEquals(surface.getZDataAsPrimitive(), other.getZDataAsPrimitive(), 0); surface = new NodalDoublesSurface(X_OBJECT, Y_OBJECT, Z_OBJECT); other = NodalDoublesSurface.from(X_OBJECT, Y_OBJECT, Z_OBJECT); assertFalse(other.equals(surface)); assertArrayEquals(surface.getXDataAsPrimitive(), other.getXDataAsPrimitive(), 0); assertArrayEquals(surface.getYDataAsPrimitive(), other.getYDataAsPrimitive(), 0); assertArrayEquals(surface.getZDataAsPrimitive(), other.getZDataAsPrimitive(), 0); surface = new NodalDoublesSurface(X_LIST, Y_LIST, Z_LIST); other = NodalDoublesSurface.from(X_LIST, Y_LIST, Z_LIST); assertFalse(other.equals(surface)); assertArrayEquals(surface.getXDataAsPrimitive(), other.getXDataAsPrimitive(), 0); assertArrayEquals(surface.getYDataAsPrimitive(), other.getYDataAsPrimitive(), 0); assertArrayEquals(surface.getZDataAsPrimitive(), other.getZDataAsPrimitive(), 0); surface = new NodalDoublesSurface(XY_PAIR, Z_PRIMITIVE); other = NodalDoublesSurface.from(XY_PAIR, Z_PRIMITIVE); assertFalse(other.equals(surface)); assertArrayEquals(surface.getXDataAsPrimitive(), other.getXDataAsPrimitive(), 0); assertArrayEquals(surface.getYDataAsPrimitive(), other.getYDataAsPrimitive(), 0); assertArrayEquals(surface.getZDataAsPrimitive(), other.getZDataAsPrimitive(), 0); surface = new NodalDoublesSurface(XY_PAIR, Z_OBJECT); other = NodalDoublesSurface.from(XY_PAIR, Z_OBJECT); assertFalse(other.equals(surface)); assertArrayEquals(surface.getXDataAsPrimitive(), other.getXDataAsPrimitive(), 0); assertArrayEquals(surface.getYDataAsPrimitive(), other.getYDataAsPrimitive(), 0); assertArrayEquals(surface.getZDataAsPrimitive(), other.getZDataAsPrimitive(), 0); surface = new NodalDoublesSurface(XY_PAIR_LIST, Z_LIST); other = NodalDoublesSurface.from(XY_PAIR_LIST, Z_LIST); assertFalse(other.equals(surface)); assertArrayEquals(surface.getXDataAsPrimitive(), other.getXDataAsPrimitive(), 0); assertArrayEquals(surface.getYDataAsPrimitive(), other.getYDataAsPrimitive(), 0); assertArrayEquals(surface.getZDataAsPrimitive(), other.getZDataAsPrimitive(), 0); surface = new NodalDoublesSurface(XYZ_MAP); other = NodalDoublesSurface.from(XYZ_MAP); assertFalse(other.equals(surface)); assertArrayEquals(surface.getXDataAsPrimitive(), other.getXDataAsPrimitive(), 0); assertArrayEquals(surface.getYDataAsPrimitive(), other.getYDataAsPrimitive(), 0); assertArrayEquals(surface.getZDataAsPrimitive(), other.getZDataAsPrimitive(), 0); surface = new NodalDoublesSurface(XYZ_LIST); other = NodalDoublesSurface.from(XYZ_LIST); assertFalse(other.equals(surface)); assertArrayEquals(surface.getXDataAsPrimitive(), other.getXDataAsPrimitive(), 0); assertArrayEquals(surface.getYDataAsPrimitive(), other.getYDataAsPrimitive(), 0); assertArrayEquals(surface.getZDataAsPrimitive(), other.getZDataAsPrimitive(), 0); }
@Test public void testGetters() { final NodalDoublesSurface surface = NodalDoublesSurface.from(XYZ_LIST, NAME); assertEquals(surface.getName(), NAME); assertArrayEquals(surface.getXData(), X_OBJECT); assertArrayEquals(surface.getXDataAsPrimitive(), X_PRIMITIVE, 0); assertArrayEquals(surface.getYData(), Y_OBJECT); assertArrayEquals(surface.getYDataAsPrimitive(), Y_PRIMITIVE, 0); assertArrayEquals(surface.getZData(), Z_OBJECT); assertArrayEquals(surface.getZDataAsPrimitive(), Z_PRIMITIVE, 0); assertEquals(surface.size(), Z_PRIMITIVE.length); }