This is an automated email from the ASF dual-hosted git repository. mattjuntunen pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-geometry.git
The following commit(s) were added to refs/heads/master by this push: new 2c84bf3 GEOMETRY-109: renaming BoundarySourceXX.from() to BoundarySourceXX.of() 2c84bf3 is described below commit 2c84bf3b0e458ed98248b91c60c8d27705488e7c Author: Matt Juntunen <mattjuntu...@apache.org> AuthorDate: Tue Dec 22 11:58:15 2020 -0500 GEOMETRY-109: renaming BoundarySourceXX.from() to BoundarySourceXX.of() --- .../euclidean/threed/BoundarySource3D.java | 6 +++--- .../geometry/euclidean/twod/BoundarySource2D.java | 6 +++--- .../euclidean/threed/BoundarySource3DTest.java | 24 +++++++++++----------- .../threed/BoundarySourceBoundsBuilder3DTest.java | 10 ++++----- .../threed/BoundarySourceLinecaster3DTest.java | 4 ++-- .../threed/mesh/SimpleTriangleMeshTest.java | 6 +++--- .../euclidean/twod/BoundarySource2DTest.java | 24 +++++++++++----------- .../twod/BoundarySourceBoundsBuilder2DTest.java | 10 ++++----- .../twod/BoundarySourceLinecaster2DTest.java | 4 ++-- .../threed/DefaultModelIOHandlerRegistryTest.java | 2 +- .../io/threed/ModelIOHandlerRegistryTest.java | 4 ++-- .../geometry/examples/io/threed/ModelIOTest.java | 2 +- .../io/threed/obj/OBJModelIOHandlerTest.java | 12 +++++------ .../examples/io/threed/obj/OBJWriterTest.java | 4 ++-- .../geometry/spherical/twod/BoundarySource2S.java | 6 +++--- .../spherical/twod/BoundarySource2STest.java | 8 ++++---- 16 files changed, 66 insertions(+), 66 deletions(-) diff --git a/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/threed/BoundarySource3D.java b/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/threed/BoundarySource3D.java index 7188f2d..fc7511d 100644 --- a/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/threed/BoundarySource3D.java +++ b/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/threed/BoundarySource3D.java @@ -104,8 +104,8 @@ public interface BoundarySource3D extends BoundarySource<PlaneConvexSubset>, Lin * @param boundaries boundaries to include in the boundary source * @return a boundary source containing the given boundaries */ - static BoundarySource3D from(final PlaneConvexSubset... boundaries) { - return from(Arrays.asList(boundaries)); + static BoundarySource3D of(final PlaneConvexSubset... boundaries) { + return of(Arrays.asList(boundaries)); } /** Return a {@link BoundarySource3D} instance containing the given boundaries. The given @@ -113,7 +113,7 @@ public interface BoundarySource3D extends BoundarySource<PlaneConvexSubset>, Lin * @param boundaries boundaries to include in the boundary source * @return a boundary source containing the given boundaries */ - static BoundarySource3D from(final Collection<PlaneConvexSubset> boundaries) { + static BoundarySource3D of(final Collection<PlaneConvexSubset> boundaries) { return boundaries::stream; } } diff --git a/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/twod/BoundarySource2D.java b/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/twod/BoundarySource2D.java index cd7f6fc..cfe079a 100644 --- a/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/twod/BoundarySource2D.java +++ b/commons-geometry-euclidean/src/main/java/org/apache/commons/geometry/euclidean/twod/BoundarySource2D.java @@ -77,8 +77,8 @@ public interface BoundarySource2D extends BoundarySource<LineConvexSubset>, Line * @param boundaries line subsets to include in the boundary source * @return a boundary source containing the given boundaries */ - static BoundarySource2D from(final LineConvexSubset... boundaries) { - return from(Arrays.asList(boundaries)); + static BoundarySource2D of(final LineConvexSubset... boundaries) { + return of(Arrays.asList(boundaries)); } /** Return a {@link BoundarySource2D} instance containing the given boundaries. The given @@ -86,7 +86,7 @@ public interface BoundarySource2D extends BoundarySource<LineConvexSubset>, Line * @param boundaries line subsets to include in the boundary source * @return a boundary source containing the given boundaries */ - static BoundarySource2D from(final Collection<LineConvexSubset> boundaries) { + static BoundarySource2D of(final Collection<LineConvexSubset> boundaries) { return boundaries::stream; } } diff --git a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/BoundarySource3DTest.java b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/BoundarySource3DTest.java index f2767a8..6440cd3 100644 --- a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/BoundarySource3DTest.java +++ b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/BoundarySource3DTest.java @@ -36,7 +36,7 @@ public class BoundarySource3DTest { @Test public void testToList() { // act - final BoundarySource3D src = BoundarySource3D.from( + final BoundarySource3D src = BoundarySource3D.of( Planes.convexPolygonFromVertices( Arrays.asList(Vector3D.ZERO, Vector3D.Unit.PLUS_X, Vector3D.Unit.PLUS_Y), TEST_PRECISION) ); @@ -51,7 +51,7 @@ public class BoundarySource3DTest { @Test public void testToList_noBoundaries() { // act - final BoundarySource3D src = BoundarySource3D.from(); + final BoundarySource3D src = BoundarySource3D.of(); // act final BoundaryList3D list = src.toList(); @@ -68,7 +68,7 @@ public class BoundarySource3DTest { final PlaneConvexSubset b = Planes.convexPolygonFromVertices( Arrays.asList(Vector3D.ZERO, Vector3D.Unit.PLUS_Y, Vector3D.Unit.MINUS_Z), TEST_PRECISION); - final BoundarySource3D src = BoundarySource3D.from(a, b); + final BoundarySource3D src = BoundarySource3D.of(a, b); // act final RegionBSPTree3D tree = src.toTree(); @@ -82,7 +82,7 @@ public class BoundarySource3DTest { @Test public void testToTree_noBoundaries() { // act - final BoundarySource3D src = BoundarySource3D.from(); + final BoundarySource3D src = BoundarySource3D.of(); // act final RegionBSPTree3D tree = src.toTree(); @@ -94,9 +94,9 @@ public class BoundarySource3DTest { } @Test - public void testFrom_varargs_empty() { + public void testOf_varargs_empty() { // act - final BoundarySource3D src = BoundarySource3D.from(); + final BoundarySource3D src = BoundarySource3D.of(); // assert final List<PlaneConvexSubset> segments = src.boundaryStream().collect(Collectors.toList()); @@ -104,14 +104,14 @@ public class BoundarySource3DTest { } @Test - public void testFrom_varargs() { + public void testOf_varargs() { // act final PlaneConvexSubset a = Planes.convexPolygonFromVertices( Arrays.asList(Vector3D.ZERO, Vector3D.Unit.PLUS_X, Vector3D.Unit.PLUS_Y), TEST_PRECISION); final PlaneConvexSubset b = Planes.convexPolygonFromVertices( Arrays.asList(Vector3D.ZERO, Vector3D.Unit.PLUS_Y, Vector3D.Unit.MINUS_Z), TEST_PRECISION); - final BoundarySource3D src = BoundarySource3D.from(a, b); + final BoundarySource3D src = BoundarySource3D.of(a, b); // assert final List<PlaneConvexSubset> boundaries = src.boundaryStream().collect(Collectors.toList()); @@ -122,12 +122,12 @@ public class BoundarySource3DTest { } @Test - public void testFrom_list_empty() { + public void testOf_list_empty() { // arrange final List<PlaneConvexSubset> input = new ArrayList<>(); // act - final BoundarySource3D src = BoundarySource3D.from(input); + final BoundarySource3D src = BoundarySource3D.of(input); // assert final List<PlaneConvexSubset> segments = src.boundaryStream().collect(Collectors.toList()); @@ -135,7 +135,7 @@ public class BoundarySource3DTest { } @Test - public void testFrom_list() { + public void testOf_list() { // act final PlaneConvexSubset a = Planes.convexPolygonFromVertices( Arrays.asList(Vector3D.ZERO, Vector3D.Unit.PLUS_X, Vector3D.Unit.PLUS_Y), TEST_PRECISION); @@ -146,7 +146,7 @@ public class BoundarySource3DTest { input.add(a); input.add(b); - final BoundarySource3D src = BoundarySource3D.from(input); + final BoundarySource3D src = BoundarySource3D.of(input); // assert final List<PlaneConvexSubset> segments = src.boundaryStream().collect(Collectors.toList()); diff --git a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/BoundarySourceBoundsBuilder3DTest.java b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/BoundarySourceBoundsBuilder3DTest.java index 920d344..5d4ecf2 100644 --- a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/BoundarySourceBoundsBuilder3DTest.java +++ b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/BoundarySourceBoundsBuilder3DTest.java @@ -35,7 +35,7 @@ public class BoundarySourceBoundsBuilder3DTest { @Test public void testGetBounds_noBoundaries() { // arrange - final BoundarySource3D src = BoundarySource3D.from(new ArrayList<>()); + final BoundarySource3D src = BoundarySource3D.of(new ArrayList<>()); final BoundarySourceBoundsBuilder3D builder = new BoundarySourceBoundsBuilder3D(); // act @@ -53,7 +53,7 @@ public class BoundarySourceBoundsBuilder3DTest { Vector3D.of(1, 0, 2), Vector3D.of(3, 4, 5)), TEST_PRECISION); - final BoundarySource3D src = BoundarySource3D.from(poly); + final BoundarySource3D src = BoundarySource3D.of(poly); final BoundarySourceBoundsBuilder3D builder = new BoundarySourceBoundsBuilder3D(); // act @@ -84,7 +84,7 @@ public class BoundarySourceBoundsBuilder3DTest { Vector3D.of(1, 7, 2), Vector3D.of(5, 4, 10)), TEST_PRECISION); - final BoundarySource3D src = BoundarySource3D.from(poly1, poly2, poly3); + final BoundarySource3D src = BoundarySource3D.of(poly1, poly2, poly3); final BoundarySourceBoundsBuilder3D builder = new BoundarySourceBoundsBuilder3D(); // act @@ -105,7 +105,7 @@ public class BoundarySourceBoundsBuilder3DTest { // arrange final PlaneConvexSubset boundary = Planes.fromPointAndNormal(Vector3D.ZERO, Vector3D.Unit.PLUS_Z, TEST_PRECISION) .span(); - final BoundarySource3D src = BoundarySource3D.from(boundary); + final BoundarySource3D src = BoundarySource3D.of(boundary); final BoundarySourceBoundsBuilder3D builder = new BoundarySourceBoundsBuilder3D(); // act @@ -138,7 +138,7 @@ public class BoundarySourceBoundsBuilder3DTest { Vector3D.of(1, 7, 2), Vector3D.of(5, 4, 10)), TEST_PRECISION); - final BoundarySource3D src = BoundarySource3D.from(poly1, poly2, inf, poly3); + final BoundarySource3D src = BoundarySource3D.of(poly1, poly2, inf, poly3); final BoundarySourceBoundsBuilder3D builder = new BoundarySourceBoundsBuilder3D(); // act diff --git a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/BoundarySourceLinecaster3DTest.java b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/BoundarySourceLinecaster3DTest.java index 90b2209..4b89b10 100644 --- a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/BoundarySourceLinecaster3DTest.java +++ b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/BoundarySourceLinecaster3DTest.java @@ -101,7 +101,7 @@ public class BoundarySourceLinecaster3DTest { @Test public void testLinecast_line_removesDuplicatePoints() { // arrange - final BoundarySource3D src = BoundarySource3D.from( + final BoundarySource3D src = BoundarySource3D.of( Planes.convexPolygonFromVertices(Arrays.asList(Vector3D.ZERO, Vector3D.Unit.PLUS_X, Vector3D.Unit.PLUS_Y), TEST_PRECISION), Planes.convexPolygonFromVertices(Arrays.asList(Vector3D.ZERO, Vector3D.Unit.PLUS_Y, Vector3D.Unit.MINUS_X), TEST_PRECISION) ); @@ -234,7 +234,7 @@ public class BoundarySourceLinecaster3DTest { @Test public void testLinecast_segment_removesDuplicatePoints() { // arrange - final BoundarySource3D src = BoundarySource3D.from( + final BoundarySource3D src = BoundarySource3D.of( Planes.convexPolygonFromVertices(Arrays.asList(Vector3D.ZERO, Vector3D.Unit.PLUS_X, Vector3D.Unit.PLUS_Y), TEST_PRECISION), Planes.convexPolygonFromVertices(Arrays.asList(Vector3D.ZERO, Vector3D.Unit.PLUS_Y, Vector3D.Unit.MINUS_X), TEST_PRECISION) ); diff --git a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/mesh/SimpleTriangleMeshTest.java b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/mesh/SimpleTriangleMeshTest.java index 0fffebb..381dc4f 100644 --- a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/mesh/SimpleTriangleMeshTest.java +++ b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/mesh/SimpleTriangleMeshTest.java @@ -173,7 +173,7 @@ public class SimpleTriangleMeshTest { @Test public void testFrom_boundarySource_empty() { // act - final SimpleTriangleMesh mesh = SimpleTriangleMesh.from(BoundarySource3D.from(Collections.emptyList()), + final SimpleTriangleMesh mesh = SimpleTriangleMesh.from(BoundarySource3D.of(Collections.emptyList()), TEST_PRECISION); // assert @@ -431,7 +431,7 @@ public class SimpleTriangleMeshTest { // arrange final Triangle3D tri = Planes.triangleFromVertices(Vector3D.ZERO, Vector3D.of(1, 0, 0), Vector3D.of(0, 1, 0), TEST_PRECISION); - final SimpleTriangleMesh mesh = SimpleTriangleMesh.from(BoundarySource3D.from(tri), TEST_PRECISION); + final SimpleTriangleMesh mesh = SimpleTriangleMesh.from(BoundarySource3D.of(tri), TEST_PRECISION); // act final String str = mesh.toString(); @@ -445,7 +445,7 @@ public class SimpleTriangleMeshTest { // arrange final Triangle3D tri = Planes.triangleFromVertices(Vector3D.ZERO, Vector3D.of(1, 0, 0), Vector3D.of(0, 1, 0), TEST_PRECISION); - final SimpleTriangleMesh mesh = SimpleTriangleMesh.from(BoundarySource3D.from(tri), TEST_PRECISION); + final SimpleTriangleMesh mesh = SimpleTriangleMesh.from(BoundarySource3D.of(tri), TEST_PRECISION); // act final String str = mesh.getFace(0).toString(); diff --git a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/twod/BoundarySource2DTest.java b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/twod/BoundarySource2DTest.java index ae736cb..0f8d2e3 100644 --- a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/twod/BoundarySource2DTest.java +++ b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/twod/BoundarySource2DTest.java @@ -35,7 +35,7 @@ public class BoundarySource2DTest { @Test public void testToList() { // act - final BoundarySource2D src = BoundarySource2D.from( + final BoundarySource2D src = BoundarySource2D.of( Lines.segmentFromPoints(Vector2D.ZERO, Vector2D.of(1, 0), TEST_PRECISION), Lines.segmentFromPoints(Vector2D.of(1, 0), Vector2D.of(1, 1), TEST_PRECISION) ); @@ -50,7 +50,7 @@ public class BoundarySource2DTest { @Test public void testToList_noBoundaries() { // act - final BoundarySource2D src = BoundarySource2D.from(); + final BoundarySource2D src = BoundarySource2D.of(); // act final BoundaryList2D list = src.toList(); @@ -62,7 +62,7 @@ public class BoundarySource2DTest { @Test public void testToTree() { // act - final BoundarySource2D src = BoundarySource2D.from( + final BoundarySource2D src = BoundarySource2D.of( Lines.segmentFromPoints(Vector2D.ZERO, Vector2D.of(1, 0), TEST_PRECISION), Lines.segmentFromPoints(Vector2D.of(1, 0), Vector2D.of(1, 1), TEST_PRECISION) ); @@ -79,7 +79,7 @@ public class BoundarySource2DTest { @Test public void testToTree_noBoundaries() { // act - final BoundarySource2D src = BoundarySource2D.from(); + final BoundarySource2D src = BoundarySource2D.of(); // act final RegionBSPTree2D tree = src.toTree(); @@ -91,9 +91,9 @@ public class BoundarySource2DTest { } @Test - public void testFrom_varargs_empty() { + public void testOf_varargs_empty() { // act - final BoundarySource2D src = BoundarySource2D.from(); + final BoundarySource2D src = BoundarySource2D.of(); // assert final List<LineConvexSubset> segments = src.boundaryStream().collect(Collectors.toList()); @@ -101,12 +101,12 @@ public class BoundarySource2DTest { } @Test - public void testFrom_varargs() { + public void testOf_varargs() { // act final Segment a = Lines.segmentFromPoints(Vector2D.ZERO, Vector2D.Unit.PLUS_X, TEST_PRECISION); final Segment b = Lines.segmentFromPoints(Vector2D.Unit.PLUS_X, Vector2D.of(1, 1), TEST_PRECISION); - final BoundarySource2D src = BoundarySource2D.from(a, b); + final BoundarySource2D src = BoundarySource2D.of(a, b); // assert final List<LineConvexSubset> segments = src.boundaryStream().collect(Collectors.toList()); @@ -117,12 +117,12 @@ public class BoundarySource2DTest { } @Test - public void testFrom_list_empty() { + public void testOf_list_empty() { // arrange final List<LineConvexSubset> input = new ArrayList<>(); // act - final BoundarySource2D src = BoundarySource2D.from(input); + final BoundarySource2D src = BoundarySource2D.of(input); // assert final List<LineConvexSubset> segments = src.boundaryStream().collect(Collectors.toList()); @@ -130,7 +130,7 @@ public class BoundarySource2DTest { } @Test - public void testFrom_list() { + public void testOf_list() { // act final Segment a = Lines.segmentFromPoints(Vector2D.ZERO, Vector2D.Unit.PLUS_X, TEST_PRECISION); final Segment b = Lines.segmentFromPoints(Vector2D.Unit.PLUS_X, Vector2D.of(1, 1), TEST_PRECISION); @@ -139,7 +139,7 @@ public class BoundarySource2DTest { input.add(a); input.add(b); - final BoundarySource2D src = BoundarySource2D.from(input); + final BoundarySource2D src = BoundarySource2D.of(input); // assert final List<LineConvexSubset> segments = src.boundaryStream().collect(Collectors.toList()); diff --git a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/twod/BoundarySourceBoundsBuilder2DTest.java b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/twod/BoundarySourceBoundsBuilder2DTest.java index 068ea9a..1f2117d 100644 --- a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/twod/BoundarySourceBoundsBuilder2DTest.java +++ b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/twod/BoundarySourceBoundsBuilder2DTest.java @@ -34,7 +34,7 @@ public class BoundarySourceBoundsBuilder2DTest { @Test public void testGetBounds_noBoundaries() { // arrange - final BoundarySource2D src = BoundarySource2D.from(new ArrayList<>()); + final BoundarySource2D src = BoundarySource2D.of(new ArrayList<>()); final BoundarySourceBoundsBuilder2D builder = new BoundarySourceBoundsBuilder2D(); // act @@ -49,7 +49,7 @@ public class BoundarySourceBoundsBuilder2DTest { // arrange final Segment seg = Lines.segmentFromPoints(Vector2D.of(1, -2), Vector2D.of(-3, 4), TEST_PRECISION); - final BoundarySource2D src = BoundarySource2D.from(seg); + final BoundarySource2D src = BoundarySource2D.of(seg); final BoundarySourceBoundsBuilder2D builder = new BoundarySourceBoundsBuilder2D(); // act @@ -68,7 +68,7 @@ public class BoundarySourceBoundsBuilder2DTest { final Segment seg2 = Lines.segmentFromPoints(Vector2D.of(0, 1), Vector2D.of(7, 0), TEST_PRECISION); final Segment seg3 = Lines.segmentFromPoints(Vector2D.of(4, 6), Vector2D.of(-3, 9), TEST_PRECISION); - final BoundarySource2D src = BoundarySource2D.from(seg1, seg2, seg3); + final BoundarySource2D src = BoundarySource2D.of(seg1, seg2, seg3); final BoundarySourceBoundsBuilder2D builder = new BoundarySourceBoundsBuilder2D(); // act @@ -88,7 +88,7 @@ public class BoundarySourceBoundsBuilder2DTest { // arrange final LineConvexSubset boundary = Lines.fromPointAndDirection(Vector2D.ZERO, Vector2D.Unit.PLUS_X, TEST_PRECISION) .span(); - final BoundarySource2D src = BoundarySource2D.from(boundary); + final BoundarySource2D src = BoundarySource2D.of(boundary); final BoundarySourceBoundsBuilder2D builder = new BoundarySourceBoundsBuilder2D(); // act @@ -110,7 +110,7 @@ public class BoundarySourceBoundsBuilder2DTest { final Segment seg2 = Lines.segmentFromPoints(Vector2D.of(0, 1), Vector2D.of(7, 0), TEST_PRECISION); final Segment seg3 = Lines.segmentFromPoints(Vector2D.of(4, 6), Vector2D.of(-3, 9), TEST_PRECISION); - final BoundarySource2D src = BoundarySource2D.from(seg1, seg2, inf, seg3); + final BoundarySource2D src = BoundarySource2D.of(seg1, seg2, inf, seg3); final BoundarySourceBoundsBuilder2D builder = new BoundarySourceBoundsBuilder2D(); // act diff --git a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/twod/BoundarySourceLinecaster2DTest.java b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/twod/BoundarySourceLinecaster2DTest.java index 04b0955..c77100d 100644 --- a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/twod/BoundarySourceLinecaster2DTest.java +++ b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/twod/BoundarySourceLinecaster2DTest.java @@ -92,7 +92,7 @@ public class BoundarySourceLinecaster2DTest { @Test public void testLinecast_line_removesDuplicatePoints() { // arrange - final BoundarySource2D src = BoundarySource2D.from( + final BoundarySource2D src = BoundarySource2D.of( Lines.segmentFromPoints(Vector2D.of(-1, -1), Vector2D.ZERO, TEST_PRECISION), Lines.segmentFromPoints(Vector2D.ZERO, Vector2D.of(1, 1), TEST_PRECISION) ); @@ -220,7 +220,7 @@ public class BoundarySourceLinecaster2DTest { @Test public void testLinecast_segment_removesDuplicatePoints() { // arrange - final BoundarySource2D src = BoundarySource2D.from( + final BoundarySource2D src = BoundarySource2D.of( Lines.segmentFromPoints(Vector2D.of(-1, -1), Vector2D.ZERO, TEST_PRECISION), Lines.segmentFromPoints(Vector2D.ZERO, Vector2D.of(1, 1), TEST_PRECISION) ); diff --git a/commons-geometry-examples/examples-io/src/test/java/org/apache/commons/geometry/examples/io/threed/DefaultModelIOHandlerRegistryTest.java b/commons-geometry-examples/examples-io/src/test/java/org/apache/commons/geometry/examples/io/threed/DefaultModelIOHandlerRegistryTest.java index deeba97..5e9809b 100644 --- a/commons-geometry-examples/examples-io/src/test/java/org/apache/commons/geometry/examples/io/threed/DefaultModelIOHandlerRegistryTest.java +++ b/commons-geometry-examples/examples-io/src/test/java/org/apache/commons/geometry/examples/io/threed/DefaultModelIOHandlerRegistryTest.java @@ -64,7 +64,7 @@ public class DefaultModelIOHandlerRegistryTest { private void checkWriteRead(final String type) { // arrange - final BoundarySource3D model = BoundarySource3D.from( + final BoundarySource3D model = BoundarySource3D.of( Planes.triangleFromVertices(Vector3D.ZERO, Vector3D.of(1, 0, 0), Vector3D.of(0, 1, 0), TEST_PRECISION) ); diff --git a/commons-geometry-examples/examples-io/src/test/java/org/apache/commons/geometry/examples/io/threed/ModelIOHandlerRegistryTest.java b/commons-geometry-examples/examples-io/src/test/java/org/apache/commons/geometry/examples/io/threed/ModelIOHandlerRegistryTest.java index 55320fe..9fde287 100644 --- a/commons-geometry-examples/examples-io/src/test/java/org/apache/commons/geometry/examples/io/threed/ModelIOHandlerRegistryTest.java +++ b/commons-geometry-examples/examples-io/src/test/java/org/apache/commons/geometry/examples/io/threed/ModelIOHandlerRegistryTest.java @@ -38,9 +38,9 @@ public class ModelIOHandlerRegistryTest { private static final DoublePrecisionContext TEST_PRECISION = new EpsilonDoublePrecisionContext(TEST_EPS); - private static final BoundarySource3D SRC_A = BoundarySource3D.from(); + private static final BoundarySource3D SRC_A = BoundarySource3D.of(); - private static final BoundarySource3D SRC_B = BoundarySource3D.from(); + private static final BoundarySource3D SRC_B = BoundarySource3D.of(); private final ModelIOHandlerRegistry registry = new ModelIOHandlerRegistry(); diff --git a/commons-geometry-examples/examples-io/src/test/java/org/apache/commons/geometry/examples/io/threed/ModelIOTest.java b/commons-geometry-examples/examples-io/src/test/java/org/apache/commons/geometry/examples/io/threed/ModelIOTest.java index 8480681..fefee38 100644 --- a/commons-geometry-examples/examples-io/src/test/java/org/apache/commons/geometry/examples/io/threed/ModelIOTest.java +++ b/commons-geometry-examples/examples-io/src/test/java/org/apache/commons/geometry/examples/io/threed/ModelIOTest.java @@ -100,7 +100,7 @@ public class ModelIOTest { private void checkWriteRead(final ModelIOFunction fn) throws IOException { // arrange - final BoundarySource3D model = BoundarySource3D.from( + final BoundarySource3D model = BoundarySource3D.of( Planes.triangleFromVertices(Vector3D.ZERO, Vector3D.of(1, 0, 0), Vector3D.of(0, 1, 0), TEST_PRECISION) ); diff --git a/commons-geometry-examples/examples-io/src/test/java/org/apache/commons/geometry/examples/io/threed/obj/OBJModelIOHandlerTest.java b/commons-geometry-examples/examples-io/src/test/java/org/apache/commons/geometry/examples/io/threed/obj/OBJModelIOHandlerTest.java index dc7bcd8..e399de7 100644 --- a/commons-geometry-examples/examples-io/src/test/java/org/apache/commons/geometry/examples/io/threed/obj/OBJModelIOHandlerTest.java +++ b/commons-geometry-examples/examples-io/src/test/java/org/apache/commons/geometry/examples/io/threed/obj/OBJModelIOHandlerTest.java @@ -142,7 +142,7 @@ public class OBJModelIOHandlerTest { // arrange final File out = new File(anotherTempDir, "out.obj"); - final BoundarySource3D src = BoundarySource3D.from( + final BoundarySource3D src = BoundarySource3D.of( Planes.triangleFromVertices(Vector3D.ZERO, Vector3D.of(1, 0, 0), Vector3D.of(0, 1, 0), TEST_PRECISION) ); @@ -159,7 +159,7 @@ public class OBJModelIOHandlerTest { public void testWrite_toFile_unsupportedFormat() throws Exception { // arrange final File out = new File(anotherTempDir, "out.obj"); - final BoundarySource3D src = BoundarySource3D.from( + final BoundarySource3D src = BoundarySource3D.of( Planes.triangleFromVertices(Vector3D.ZERO, Vector3D.of(1, 0, 0), Vector3D.of(0, 1, 0), TEST_PRECISION) ); @@ -173,7 +173,7 @@ public class OBJModelIOHandlerTest { public void testWrite_toFile_ioException() throws Exception { // arrange final File out = new File(anotherTempDir, "notafolder/notafile"); - final BoundarySource3D src = BoundarySource3D.from( + final BoundarySource3D src = BoundarySource3D.of( Planes.triangleFromVertices(Vector3D.ZERO, Vector3D.of(1, 0, 0), Vector3D.of(0, 1, 0), TEST_PRECISION) ); @@ -188,7 +188,7 @@ public class OBJModelIOHandlerTest { // arrange final ByteArrayOutputStream out = new ByteArrayOutputStream(); - final BoundarySource3D src = BoundarySource3D.from( + final BoundarySource3D src = BoundarySource3D.of( Planes.triangleFromVertices(Vector3D.ZERO, Vector3D.of(1, 0, 0), Vector3D.of(0, 1, 0), TEST_PRECISION) ); @@ -206,7 +206,7 @@ public class OBJModelIOHandlerTest { public void testWrite_toStream_unsupportedFormat() throws Exception { // arrange final File file = new File(anotherTempDir, "out.obj"); - final BoundarySource3D src = BoundarySource3D.from( + final BoundarySource3D src = BoundarySource3D.of( Planes.triangleFromVertices(Vector3D.ZERO, Vector3D.of(1, 0, 0), Vector3D.of(0, 1, 0), TEST_PRECISION) ); @@ -221,7 +221,7 @@ public class OBJModelIOHandlerTest { @Test public void testWrite_toStream_ioException() throws Exception { // arrange - final BoundarySource3D src = BoundarySource3D.from( + final BoundarySource3D src = BoundarySource3D.of( Planes.triangleFromVertices(Vector3D.ZERO, Vector3D.of(1, 0, 0), Vector3D.of(0, 1, 0), TEST_PRECISION) ); diff --git a/commons-geometry-examples/examples-io/src/test/java/org/apache/commons/geometry/examples/io/threed/obj/OBJWriterTest.java b/commons-geometry-examples/examples-io/src/test/java/org/apache/commons/geometry/examples/io/threed/obj/OBJWriterTest.java index d3b86db..1c7674c 100644 --- a/commons-geometry-examples/examples-io/src/test/java/org/apache/commons/geometry/examples/io/threed/obj/OBJWriterTest.java +++ b/commons-geometry-examples/examples-io/src/test/java/org/apache/commons/geometry/examples/io/threed/obj/OBJWriterTest.java @@ -270,7 +270,7 @@ public class OBJWriterTest { @Test public void testWriteBoundaries_nonMeshArgument() throws IOException { // arrange - final BoundarySource3D src = BoundarySource3D.from( + final BoundarySource3D src = BoundarySource3D.of( Planes.triangleFromVertices(Vector3D.ZERO, Vector3D.of(1, 0, 0), Vector3D.of(0, 1, 0), TEST_PRECISION), Planes.triangleFromVertices(Vector3D.ZERO, Vector3D.of(1, 0, 0), Vector3D.of(0, 0, 1), TEST_PRECISION) ); @@ -297,7 +297,7 @@ public class OBJWriterTest { @Test public void testWriteBoundaries_infiniteBoundary() throws IOException { // arrange - final BoundarySource3D src = BoundarySource3D.from( + final BoundarySource3D src = BoundarySource3D.of( Planes.triangleFromVertices(Vector3D.ZERO, Vector3D.of(1, 0, 0), Vector3D.of(0, 1, 0), TEST_PRECISION), Planes.fromPointAndNormal(Vector3D.ZERO, Vector3D.Unit.PLUS_Z, TEST_PRECISION).span() ); diff --git a/commons-geometry-spherical/src/main/java/org/apache/commons/geometry/spherical/twod/BoundarySource2S.java b/commons-geometry-spherical/src/main/java/org/apache/commons/geometry/spherical/twod/BoundarySource2S.java index 749904d..9004535 100644 --- a/commons-geometry-spherical/src/main/java/org/apache/commons/geometry/spherical/twod/BoundarySource2S.java +++ b/commons-geometry-spherical/src/main/java/org/apache/commons/geometry/spherical/twod/BoundarySource2S.java @@ -54,8 +54,8 @@ public interface BoundarySource2S extends BoundarySource<GreatArc> { * @param boundaries boundaries to include in the boundary source * @return a boundary source containing the given boundaries */ - static BoundarySource2S from(final GreatArc... boundaries) { - return from(Arrays.asList(boundaries)); + static BoundarySource2S of(final GreatArc... boundaries) { + return of(Arrays.asList(boundaries)); } /** Return a {@link BoundarySource2S} instance containing the given boundaries. The given @@ -63,7 +63,7 @@ public interface BoundarySource2S extends BoundarySource<GreatArc> { * @param boundaries boundaries to include in the boundary source * @return a boundary source containing the given boundaries */ - static BoundarySource2S from(final Collection<GreatArc> boundaries) { + static BoundarySource2S of(final Collection<GreatArc> boundaries) { return boundaries::stream; } } diff --git a/commons-geometry-spherical/src/test/java/org/apache/commons/geometry/spherical/twod/BoundarySource2STest.java b/commons-geometry-spherical/src/test/java/org/apache/commons/geometry/spherical/twod/BoundarySource2STest.java index 0ed9362..579d52e 100644 --- a/commons-geometry-spherical/src/test/java/org/apache/commons/geometry/spherical/twod/BoundarySource2STest.java +++ b/commons-geometry-spherical/src/test/java/org/apache/commons/geometry/spherical/twod/BoundarySource2STest.java @@ -33,7 +33,7 @@ public class BoundarySource2STest { @Test public void testToList() { // act - final BoundarySource2S src = BoundarySource2S.from( + final BoundarySource2S src = BoundarySource2S.of( GreatCircles.arcFromPoints(Point2S.PLUS_I, Point2S.PLUS_J, TEST_PRECISION), GreatCircles.arcFromPoints(Point2S.PLUS_J, Point2S.PLUS_K, TEST_PRECISION) ); @@ -48,7 +48,7 @@ public class BoundarySource2STest { @Test public void testToList_noBoundaries() { // act - final BoundarySource2S src = BoundarySource2S.from(); + final BoundarySource2S src = BoundarySource2S.of(); // act final BoundaryList2S list = src.toList(); @@ -60,7 +60,7 @@ public class BoundarySource2STest { @Test public void testToTree() { // act - final BoundarySource2S src = BoundarySource2S.from( + final BoundarySource2S src = BoundarySource2S.of( GreatCircles.arcFromPoints(Point2S.PLUS_I, Point2S.PLUS_J, TEST_PRECISION)); // act @@ -75,7 +75,7 @@ public class BoundarySource2STest { @Test public void testToTree_noBoundaries() { // act - final BoundarySource2S src = BoundarySource2S.from(Collections.emptyList()); + final BoundarySource2S src = BoundarySource2S.of(Collections.emptyList()); // act final RegionBSPTree2S tree = src.toTree();