M
- Model typepublic class Clustering<M extends Model> extends BasicResult
Modifier and Type | Field and Description |
---|---|
private ModifiableHierarchy<Cluster<M>> |
hierarchy
Cluster hierarchy.
|
private List<Cluster<M>> |
toplevelclusters
Keep a list of top level clusters.
|
Constructor and Description |
---|
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
|
Modifier and Type | Method and Description |
---|---|
void |
addChildCluster(Cluster<M> parent,
Cluster<M> child)
Add a cluster to the clustering.
|
void |
addToplevelCluster(Cluster<M> clus)
Add a cluster to the clustering.
|
List<Cluster<M>> |
getAllClusters()
Collect all clusters (recursively) into a List.
|
Hierarchy<Cluster<M>> |
getClusterHierarchy()
Get the cluster hierarchy.
|
List<Cluster<M>> |
getToplevelClusters()
Return top level clusters
|
Hierarchy.Iter<Cluster<M>> |
iterToplevelClusters()
Iterate over the top level clusters.
|
getLongName, getShortName
addChildResult, getHierarchy, setHierarchy
private List<Cluster<M extends Model>> toplevelclusters
private ModifiableHierarchy<Cluster<M extends Model>> hierarchy
public Clustering(String name, String shortname, List<Cluster<M>> toplevelclusters)
name
- The long name (for pretty printing)shortname
- the short name (for filenames etc.)toplevelclusters
- Top level clusterspublic void addToplevelCluster(Cluster<M> clus)
clus
- new clusterpublic void addChildCluster(Cluster<M> parent, Cluster<M> child)
parent
- Parent clusterchild
- Child cluster.public List<Cluster<M>> getToplevelClusters()
public Hierarchy<Cluster<M>> getClusterHierarchy()
public List<Cluster<M>> getAllClusters()
public Hierarchy.Iter<Cluster<M>> iterToplevelClusters()