public abstract class ClusterSet
extends java.lang.Object
Constructor and Description |
---|
ClusterSet(ArchetypeGraph underlyingGraph)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addCluster(java.util.Set elements)
Adds a new cluster to the collection.
|
protected void |
checkLegality(Element e) |
abstract ClusterSet |
createEquivalentClusterSet(Graph anotherGraph)
Returns the corresponding cluster set in the other graph.
|
java.util.Set |
getCluster(int index)
Given the cluster's position in the list (0-based), retrieve the cluster (set of vertices)
|
abstract Graph |
getClusterAsNewSubGraph(int index)
Constructs a new graph from the given cluster
|
java.util.Set |
getClusters(Element element)
Given a vertex (or edge), retrieves the clusters which that vertex (or edge) belongs to if any
|
ArchetypeGraph |
getUnderlyingGraph() |
java.util.Iterator |
iterator()
Returns an iterator to the component list.
|
int |
size()
the size of the cluster collection.
|
void |
sort()
Sorts the clusters by size.
|
public ClusterSet(ArchetypeGraph underlyingGraph)
public void addCluster(java.util.Set elements)
elements
- the set of vertices (or edges) comprising a component to be addedprotected void checkLegality(Element e)
public abstract Graph getClusterAsNewSubGraph(int index)
index
- the position index of the cluster in the collectionpublic abstract ClusterSet createEquivalentClusterSet(Graph anotherGraph)
anotherGraph
- another graph whose corresponding clusters are to be retrievedpublic java.util.Set getClusters(Element element)
element
- the vertex (or edge) whose cluster is to be retrieved.public java.util.Set getCluster(int index)
index
- the 0-based index of the cluster in the list.public java.util.Iterator iterator()
public int size()
public void sort()
public ArchetypeGraph getUnderlyingGraph()