public class EuclideanIntegerPoint extends Object implements Clusterable<EuclideanIntegerPoint>, Serializable
Clusterable
for points with integer coordinates.Constructor and Description |
---|
EuclideanIntegerPoint(int[] pointIn)
Build an instance wrapping an integer array.
|
Modifier and Type | Method and Description |
---|---|
EuclideanIntegerPoint |
centroidOf(Collection<EuclideanIntegerPoint> points)
Returns the centroid of the given Collection of points.
|
double |
distanceFrom(EuclideanIntegerPoint p)
Returns the distance from the given point.
|
boolean |
equals(Object other) |
int[] |
getPoint()
Get the n-dimensional point in integer space.
|
int |
hashCode() |
String |
toString() |
public EuclideanIntegerPoint(int[] pointIn)
The wrapped array is referenced, it is not copied.
pointIn
- the n-dimensional point in integer spacepublic int[] getPoint()
public double distanceFrom(EuclideanIntegerPoint p)
distanceFrom
in interface Clusterable<EuclideanIntegerPoint>
p
- the point to compute the distance frompublic EuclideanIntegerPoint centroidOf(Collection<EuclideanIntegerPoint> points)
centroidOf
in interface Clusterable<EuclideanIntegerPoint>
points
- the Collection of points to compute the centroid ofCopyright © 2018 CNES. All Rights Reserved.