gov.sandia.cognition.learning.algorithm.clustering.hierarchy
Class AbstractClusterHierarchyNode<DataType,ClusterType extends Cluster<DataType>>

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.learning.algorithm.clustering.hierarchy.AbstractClusterHierarchyNode<DataType,ClusterType>
Type Parameters:
DataType - The type of the data in the cluster.
ClusterType - The type of cluster contained in the hierarchy node.
All Implemented Interfaces:
Cluster<DataType>, ClusterHierarchyNode<DataType,ClusterType>, CloneableSerializable, Serializable, Cloneable
Direct Known Subclasses:
BinaryClusterHierarchyNode, DefaultClusterHierarchyNode

public abstract class AbstractClusterHierarchyNode<DataType,ClusterType extends Cluster<DataType>>
extends AbstractCloneableSerializable
implements ClusterHierarchyNode<DataType,ClusterType>

An abstract implementation of the ClusterHierarchyNode class. It keeps track of the cluster.

Since:
2.1
Author:
Justin Basilico
See Also:
Serialized Form

Field Summary
protected  ClusterType cluster
          The cluster associated with the node.
 
Constructor Summary
AbstractClusterHierarchyNode()
          Creates a new AbstractClusterHierarchyNode.
AbstractClusterHierarchyNode(ClusterType cluster)
          Creates a new AbstractClusterHierarchyNode.
 
Method Summary
 ClusterType getCluster()
          Gets the cluster associated with the node.
 Collection<DataType> getMembers()
          Gets the member objects of the cluster.
 boolean hasChildren()
          True if this node has any children.
 void setCluster(ClusterType cluster)
          Sets the cluster associated with the node.
 
Methods inherited from class gov.sandia.cognition.util.AbstractCloneableSerializable
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.learning.algorithm.clustering.hierarchy.ClusterHierarchyNode
getChildren
 
Methods inherited from interface gov.sandia.cognition.util.CloneableSerializable
clone
 

Field Detail

cluster

protected ClusterType extends Cluster<DataType> cluster
The cluster associated with the node.

Constructor Detail

AbstractClusterHierarchyNode

public AbstractClusterHierarchyNode()
Creates a new AbstractClusterHierarchyNode.


AbstractClusterHierarchyNode

public AbstractClusterHierarchyNode(ClusterType cluster)
Creates a new AbstractClusterHierarchyNode.

Parameters:
cluster - The cluster associated with the node.
Method Detail

hasChildren

public boolean hasChildren()
Description copied from interface: ClusterHierarchyNode
True if this node has any children.

Specified by:
hasChildren in interface ClusterHierarchyNode<DataType,ClusterType extends Cluster<DataType>>
Returns:
True if this node has any children.

getMembers

public Collection<DataType> getMembers()
Description copied from interface: Cluster
Gets the member objects of the cluster.

Specified by:
getMembers in interface Cluster<DataType>
Returns:
The members of the cluster.

getCluster

public ClusterType getCluster()
Description copied from interface: ClusterHierarchyNode
Gets the cluster associated with the node.

Specified by:
getCluster in interface ClusterHierarchyNode<DataType,ClusterType extends Cluster<DataType>>
Returns:
The cluster associated with the node.

setCluster

public void setCluster(ClusterType cluster)
Sets the cluster associated with the node.

Parameters:
cluster - The cluster associated with the node.