org.apache.commons.math3.ml.clustering
Class DoublePoint

java.lang.Object
  extended by org.apache.commons.math3.ml.clustering.DoublePoint
All Implemented Interfaces:
Serializable, Clusterable

public class DoublePoint
extends Object
implements Clusterable, Serializable

A simple implementation of Clusterable for points with double coordinates.

Since:
3.2
Version:
$Id: DoublePoint.java 1461862 2013-03-27 21:48:10Z tn $
See Also:
Serialized Form

Field Summary
private  double[] point
          Point coordinates.
private static long serialVersionUID
          Serializable version identifier.
 
Constructor Summary
DoublePoint(double[] point)
          Build an instance wrapping an double array.
DoublePoint(int[] point)
          Build an instance wrapping an integer array.
 
Method Summary
 boolean equals(Object other)
          
 double[] getPoint()
          Gets the n-dimensional point.
 int hashCode()
          
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serializable version identifier.

See Also:
Constant Field Values

point

private final double[] point
Point coordinates.

Constructor Detail

DoublePoint

public DoublePoint(double[] point)
Build an instance wrapping an double array.

The wrapped array is referenced, it is not copied.

Parameters:
point - the n-dimensional point in double space

DoublePoint

public DoublePoint(int[] point)
Build an instance wrapping an integer array.

The wrapped array is copied to an internal double array.

Parameters:
point - the n-dimensional point in integer space
Method Detail

getPoint

public double[] getPoint()
Gets the n-dimensional point.

Specified by:
getPoint in interface Clusterable
Returns:
the point array

equals

public boolean equals(Object other)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

toString

public String toString()

Overrides:
toString in class Object


Copyright (c) 2003-2013 Apache Software Foundation