gov.sandia.cognition.learning.algorithm.clustering.cluster
Class CentroidCluster<ClusterType>

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.learning.algorithm.clustering.cluster.DefaultCluster<ClusterType>
          extended by gov.sandia.cognition.learning.algorithm.clustering.cluster.CentroidCluster<ClusterType>
Type Parameters:
ClusterType - The type of data stored in the cluster.
All Implemented Interfaces:
Cluster<ClusterType>, CloneableSerializable, Serializable, Cloneable

@CodeReview(reviewer="Kevin R. Dixon",
            date="2008-07-22",
            changesNeeded=false,
            comments="Code generally looks fine.")
public class CentroidCluster<ClusterType>
extends DefaultCluster<ClusterType>

The CentroidCluster class extends the default cluster to contain a central element. This type of cluster is useful in many clustering algorithms.

Since:
1.0
Author:
Justin Basilico, Kevin R. Dixon
See Also:
Serialized Form

Field Summary
protected  ClusterType centroid
          The center of the cluster.
 
Fields inherited from class gov.sandia.cognition.learning.algorithm.clustering.cluster.DefaultCluster
DEFAULT_INDEX
 
Constructor Summary
CentroidCluster()
          Creates a new instance of CentroidCluster.
CentroidCluster(ClusterType centroid)
          Creates a new instance of CentroidCluster.
CentroidCluster(ClusterType centroid, Collection<ClusterType> members)
          Creates a new instance of CentroidCluster.
CentroidCluster(int index, ClusterType centroid)
          Creates a new instance of CentroidCluster.
CentroidCluster(int index, ClusterType centroid, Collection<ClusterType> members)
          Creates a new instance of CentroidCluster.
 
Method Summary
 ClusterType getCentroid()
          Gets the centroid of the cluster.
 void setCentroid(ClusterType centroid)
          Sets the centroid of the cluster.
 
Methods inherited from class gov.sandia.cognition.learning.algorithm.clustering.cluster.DefaultCluster
clone, getIndex, getMembers, setIndex
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

centroid

protected ClusterType centroid
The center of the cluster.

Constructor Detail

CentroidCluster

public CentroidCluster()
Creates a new instance of CentroidCluster.


CentroidCluster

public CentroidCluster(ClusterType centroid)
Creates a new instance of CentroidCluster.

Parameters:
centroid - The centroid of the cluster.

CentroidCluster

public CentroidCluster(int index,
                       ClusterType centroid)
Creates a new instance of CentroidCluster.

Parameters:
index - The index of the cluster.
centroid - The centroid of the cluster.

CentroidCluster

public CentroidCluster(ClusterType centroid,
                       Collection<ClusterType> members)
Creates a new instance of CentroidCluster.

Parameters:
centroid - The centroid of the cluster.
members - The members of the cluster.

CentroidCluster

public CentroidCluster(int index,
                       ClusterType centroid,
                       Collection<ClusterType> members)
Creates a new instance of CentroidCluster.

Parameters:
index - The index of the cluster.
centroid - The centroid of the cluster.
members - The members of the cluster.
Method Detail

getCentroid

public ClusterType getCentroid()
Gets the centroid of the cluster.

Returns:
The centroid of the cluster.

setCentroid

public void setCentroid(ClusterType centroid)
Sets the centroid of the cluster.

Parameters:
centroid - The centroid of the cluster.