@Test public void shouldConstructArrayElementsViaConstantCtorAndArgsProvider() throws NoSuchMethodException { final Class[] initArgTypes = {long.class, long.class}; final long initialX = 4; final long initialY = 777; long length = 9L; final CtorAndArgs<Point> ctorAndArgs = new CtorAndArgs<Point>(Point.class, initArgTypes, initialX, initialY); final CtorAndArgsProvider<Point> ctorAndArgsProvider = new CtorAndArgsProvider<Point>() { @Override public CtorAndArgs<Point> getForContext( ConstructionContext<Point> context) throws NoSuchMethodException { return ctorAndArgs; } }; final PointArray array = PointArray.newInstance( PointArray.class, Point.class, length, ctorAndArgsProvider); assertCorrectFixedInitialisation(initialX, initialY, new long[] {length}, array); }
public static PointArray newInstance(final long length) { return StructuredArray.newInstance(PointArray.class, Point.class, length); }
PointArray extends StructuredArray<Point> { public static PointArray newInstance(final long length) { return StructuredArray.newInstance(PointArray.class, Point.class, length); } }
PointArray extends StructuredArray<Point> { public static PointArray newInstance(final long length) { return StructuredArray.newInstance(PointArray.class, Point.class, length); } PointArray(PointArray source);  PointArray(); }
PointArray extends StructuredArray<Point> { public static PointArray newInstance(final long length) { return StructuredArray.newInstance(PointArray.class, Point.class, length); } PointArray(PointArray source);  PointArray(); static PointArray newInstance(final long length); static PointArray newInstance(final long length,
                                           final CtorAndArgsProvider<Point> ctorAndArgsProvider); static PointArray newInstance(final long length, final long x, final long y); }
PointArray extends StructuredArray<Point> { public static PointArray newInstance(final long length) { return StructuredArray.newInstance(PointArray.class, Point.class, length); } PointArray(PointArray source);  PointArray(); static PointArray newInstance(final long length); static PointArray newInstance(final long length,
                                           final CtorAndArgsProvider<Point> ctorAndArgsProvider); static PointArray newInstance(final long length, final long x, final long y);  }