diff --git a/modules/core/src/main/java/org/locationtech/jts/geom/Geometry.java b/modules/core/src/main/java/org/locationtech/jts/geom/Geometry.java index 7143d3971d..e4dc1352db 100644 --- a/modules/core/src/main/java/org/locationtech/jts/geom/Geometry.java +++ b/modules/core/src/main/java/org/locationtech/jts/geom/Geometry.java @@ -49,7 +49,7 @@ * *

Overlay Methods

* - * The overlay methods + * The overlay methods * return the most specific class possible to represent the result. If the * result is homogeneous, a Point, LineString, or * Polygon will be returned if the result contains a single @@ -109,44 +109,44 @@ * report the location of the collapse.

* *

Geometry Equality

- * - * There are two ways of comparing geometries for equality: + * + * There are two ways of comparing geometries for equality: * structural equality and topological equality. - * + * *

Structural Equality

* - * Structural Equality is provided by the - * {@link #equalsExact(Geometry)} method. + * Structural Equality is provided by the + * {@link #equalsExact(Geometry)} method. * This implements a comparison based on exact, structural pointwise - * equality. - * The {@link #equals(Object)} is a synonym for this method, + * equality. + * The {@link #equals(Object)} is a synonym for this method, * to provide structural equality semantics for * use in Java collections. * It is important to note that structural pointwise equality * is easily affected by things like * ring order and component order. In many situations * it will be desirable to normalize geometries before - * comparing them (using the {@link #norm()} + * comparing them (using the {@link #norm()} * or {@link #normalize()} methods). * {@link #equalsNorm(Geometry)} is provided * as a convenience method to compute equality over * normalized geometries, but it is expensive to use. * Finally, {@link #equalsExact(Geometry, double)} * allows using a tolerance value for point comparison. - * - * + * + * *

Topological Equality

- * - * Topological Equality is provided by the - * {@link #equalsTopo(Geometry)} method. + * + * Topological Equality is provided by the + * {@link #equalsTopo(Geometry)} method. * It implements the SFS definition of point-set equality * defined in terms of the DE-9IM matrix. * To support the SFS naming convention, the method - * {@link #equals(Geometry)} is also provided as a synonym. + * {@link #equals(Geometry)} is also provided as a synonym. * However, due to the potential for confusion with {@link #equals(Object)} * its use is discouraged. *

- * Since {@link #equals(Object)} and {@link #hashCode()} are overridden, + * Since {@link #equals(Object)} and {@link #hashCode()} are overridden, * Geometries can be used effectively in Java collections. * *@version 1.7 @@ -155,7 +155,7 @@ public abstract class Geometry implements Cloneable, Comparable, Serializable { private static final long serialVersionUID = 8763622679187376702L; - + static final int SORTINDEX_POINT = 0; static final int SORTINDEX_MULTIPOINT = 1; static final int SORTINDEX_LINESTRING = 2; @@ -164,7 +164,7 @@ public abstract class Geometry static final int SORTINDEX_POLYGON = 5; static final int SORTINDEX_MULTIPOLYGON = 6; static final int SORTINDEX_GEOMETRYCOLLECTION = 7; - + private final static GeometryComponentFilter geometryChangedFilter = new GeometryComponentFilter() { public void filter(Geometry geom) { geom.geometryChangedAction(); @@ -262,12 +262,12 @@ public int getSRID() { /** * Sets the ID of the Spatial Reference System used by the Geometry. *

- * NOTE: This method should only be used for exceptional circumstances or - * for backwards compatibility. Normally the SRID should be set on the + * NOTE: This method should only be used for exceptional circumstances or + * for backwards compatibility. Normally the SRID should be set on the * {@link GeometryFactory} used to create the geometry. - * SRIDs set using this method will not be propagated to + * SRIDs set using this method will not be propagated to * geometries returned by constructive methods. - * + * * @see GeometryFactory */ public void setSRID(int SRID) { @@ -350,19 +350,19 @@ public PrecisionModel getPrecisionModel() { *@return null if this Geometry is empty */ public abstract Coordinate getCoordinate(); - + /** - * Returns an array containing the values of all the vertices for + * Returns an array containing the values of all the vertices for * this geometry. * If the geometry is a composite, the array will contain all the vertices * for the components, in the order in which the components occur in the geometry. *

- * In general, the array cannot be assumed to be the actual internal + * In general, the array cannot be assumed to be the actual internal * storage for the vertices. Thus modifying the array - * may not modify the geometry itself. + * may not modify the geometry itself. * Use the {@link CoordinateSequence#setOrdinate} method * (possibly on the components) to modify the underlying data. - * If the coordinates are modified, + * If the coordinates are modified, * {@link #geometryChanged} must be called afterwards. * *@return the vertices of this Geometry @@ -461,7 +461,7 @@ public boolean isWithinDistance(Geometry geom, double distance) /** * Tests whether this is a rectangular {@link Polygon}. - * + * * @return true if the geometry is a rectangle. */ public boolean isRectangle() @@ -510,7 +510,7 @@ public double getLength() */ public Point getCentroid() { - if (isEmpty()) + if (isEmpty()) return factory.createPoint(); Coordinate centPt = Centroid.getCentroid(this); return createPointFromInternalCoord(centPt, this); @@ -535,15 +535,15 @@ public Point getInteriorPoint() /** * Returns the dimension of this geometry. - * The dimension of a geometry is is the topological + * The dimension of a geometry is is the topological * dimension of its embedding in the 2-D Euclidean plane. * In the JTS spatial model, dimension values are in the set {0,1,2}. *

- * Note that this is a different concept to the dimension of - * the vertex {@link Coordinate}s. + * Note that this is a different concept to the dimension of + * the vertex {@link Coordinate}s. * The geometry dimension can never be greater than the coordinate dimension. - * For example, a 0-dimensional geometry (e.g. a Point) - * may have a coordinate dimension of 3 (X,Y,Z). + * For example, a 0-dimensional geometry (e.g. a Point) + * may have a coordinate dimension of 3 (X,Y,Z). * *@return the topological dimension of this geometry. */ @@ -572,35 +572,35 @@ public Point getInteriorPoint() public abstract int getBoundaryDimension(); /** - * Gets a Geometry representing the envelope (bounding box) of - * this Geometry. + * Gets a Geometry representing the envelope (bounding box) of + * this Geometry. *

* If this Geometry is: *

* *@return a Geometry representing the envelope of this Geometry - * - * @see GeometryFactory#toGeometry(Envelope) + * + * @see GeometryFactory#toGeometry(Envelope) */ public Geometry getEnvelope() { return getFactory().toGeometry(getEnvelopeInternal()); } /** - * Gets an {@link Envelope} containing + * Gets an {@link Envelope} containing * the minimum and maximum x and y values in this Geometry. - * If the geometry is empty, an empty Envelope + * If the geometry is empty, an empty Envelope * is returned. *

* The returned object is a copy of the one maintained internally, - * to avoid aliasing issues. + * to avoid aliasing issues. * For best performance, clients which access this * envelope frequently should cache the return value. * @@ -616,7 +616,7 @@ public Envelope getEnvelopeInternal() { /** * Notifies this geometry that its coordinates have been changed by an external - * party (for example, via a {@link CoordinateFilter}). + * party (for example, via a {@link CoordinateFilter}). * When this method is called the geometry will flush * and/or update any derived information it has cached (such as its {@link Envelope} ). * The operation is applied to all component Geometries. @@ -629,7 +629,7 @@ public void geometryChanged() { * Notifies this Geometry that its Coordinates have been changed by an external * party. When #geometryChanged is called, this method will be called for * this Geometry and its component Geometries. - * + * * @see #apply(GeometryComponentFilter) */ protected void geometryChangedAction() { @@ -642,7 +642,7 @@ protected void geometryChangedAction() { * The disjoint predicate has the following equivalent definitions: *