de.lmu.ifi.dbs.elki.data
Class Clustering<M extends Model>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.result.AbstractHierarchicalResult
      extended by de.lmu.ifi.dbs.elki.result.BasicResult
          extended by de.lmu.ifi.dbs.elki.data.Clustering<M>
Type Parameters:
M - Model type
All Implemented Interfaces:
HierarchicalResult, Result

public class Clustering<M extends Model>
extends BasicResult

Result class for clusterings. Can be used for both hierarchical and non-hierarchical clusterings. The class does not enforce or rely on clusterings to be a tree or DAG, instead they can be an arbitrary forest of directed graphs that COULD contain cycles. This class is NOT iterable for a simple reason: there is more than one method to do so. You need to specify whether you want to use getToplevelClusters() or getAllClusters().


Field Summary
private  List<Cluster<M>> toplevelclusters
          Keep a list of top level clusters.
 
Constructor Summary
Clustering(String name, String shortname)
          Constructor for an empty clustering
Clustering(String name, String shortname, List<Cluster<M>> toplevelclusters)
          Constructor with a list of top level clusters
 
Method Summary
 void addCluster(Cluster<M> n)
          Add a cluster to the clustering.
 List<Cluster<M>> getAllClusters()
          Collect all clusters (recursively) into a List.
 List<Cluster<M>> getToplevelClusters()
          Return top level clusters
 
Methods inherited from class de.lmu.ifi.dbs.elki.result.BasicResult
getLongName, getShortName
 
Methods inherited from class de.lmu.ifi.dbs.elki.result.AbstractHierarchicalResult
addChildResult, getHierarchy, setHierarchy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

toplevelclusters

private List<Cluster<M extends Model>> toplevelclusters
Keep a list of top level clusters.

Constructor Detail

Clustering

public Clustering(String name,
                  String shortname,
                  List<Cluster<M>> toplevelclusters)
Constructor with a list of top level clusters

Parameters:
name - The long name (for pretty printing)
shortname - the short name (for filenames etc.)
toplevelclusters - Top level clusters

Clustering

public Clustering(String name,
                  String shortname)
Constructor for an empty clustering

Parameters:
name - The long name (for pretty printing)
shortname - the short name (for filenames etc.)
Method Detail

addCluster

public void addCluster(Cluster<M> n)
Add a cluster to the clustering.

Parameters:
n - new cluster

getToplevelClusters

public List<Cluster<M>> getToplevelClusters()
Return top level clusters

Returns:
top level clusters

getAllClusters

public List<Cluster<M>> getAllClusters()
Collect all clusters (recursively) into a List.

Returns:
List of all clusters.

Release 0.4.0 (2011-09-20_1324)