org.apache.commons.math3.stat.clustering

## Class Cluster<T extends Clusterable<T>>

- java.lang.Object
- - org.apache.commons.math3.stat.clustering.Cluster<T>

- Type Parameters:
    `T` - the type of points that can be clustered
  All Implemented Interfaces:
    Serializable

      public class Cluster<T extends Clusterable<T>>
      extends Object
      implements Serializable

  Cluster holding a set of `Clusterable` points.
  Since:
    2.0
  Version:
    $Id: Cluster.java 1244107 2012-02-14 16:17:55Z erans $
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Cluster(T center)` Build a cluster centered at a specified point.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addPoint(T point)` Add a point to this cluster.
    `T` | `getCenter()` Get the point chosen to be the center of this cluster.
    `List<T>` | `getPoints()` Get the points contained in the cluster.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Cluster

          public Cluster(T center)

      Build a cluster centered at a specified point.
      Parameters:
        `center` - the point which is to be the center of this cluster

  - ### Method Detail

    - #### addPoint

          public void addPoint(T point)

      Add a point to this cluster.
      Parameters:
        `point` - point to add

    - #### getPoints

          public List<T> getPoints()

      Get the points contained in the cluster.
      Returns:
        points contained in the cluster

    - #### getCenter

          public T getCenter()

      Get the point chosen to be the center of this cluster.
      Returns:
        chosen cluster center

Copyright © 2003-2012 The Apache Software Foundation. All Rights Reserved.