Class PointPairDistance
- java.lang.Object
-
- org.locationtech.jts.algorithm.distance.PointPairDistance
-
public class PointPairDistance extends java.lang.Object
Contains a pair of points and the distance between them. Provides methods to update with a new point pair with either maximum or minimum distance.
-
-
Constructor Summary
Constructors Constructor Description PointPairDistance()
Creates an instance of this class
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Coordinate
getCoordinate(int i)
Gets one of the paired pointsCoordinate[]
getCoordinates()
Gets the paired pointsdouble
getDistance()
Gets the distance between the paired pointsvoid
initialize()
Initializes this instance.void
initialize(Coordinate p0, Coordinate p1)
Initializes the points, computing the distance between them.void
setMaximum(PointPairDistance ptDist)
void
setMaximum(Coordinate p0, Coordinate p1)
void
setMinimum(PointPairDistance ptDist)
void
setMinimum(Coordinate p0, Coordinate p1)
java.lang.String
toString()
-
-
-
Method Detail
-
initialize
public void initialize()
Initializes this instance.
-
initialize
public void initialize(Coordinate p0, Coordinate p1)
Initializes the points, computing the distance between them.- Parameters:
p0
- the 1st pointp1
- the 2nd point
-
getDistance
public double getDistance()
Gets the distance between the paired points- Returns:
- the distance between the paired points
-
getCoordinates
public Coordinate[] getCoordinates()
Gets the paired points- Returns:
- the paired points
-
getCoordinate
public Coordinate getCoordinate(int i)
Gets one of the paired points- Parameters:
i
- the index of the paired point (0 or 1)- Returns:
- A point
-
setMaximum
public void setMaximum(PointPairDistance ptDist)
-
setMaximum
public void setMaximum(Coordinate p0, Coordinate p1)
-
setMinimum
public void setMinimum(PointPairDistance ptDist)
-
setMinimum
public void setMinimum(Coordinate p0, Coordinate p1)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-