|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.uci.ics.jung.algorithms.cluster.ClusterSet
A data structure representing the clusters, connected set of vertices (or edges), in a graph. The clusters can be retrieved based upon their position index in the collection. Also, given a vertex (or edge) the corresponding clusters can be retrieved. There is no requirement that the union of the set of vertices (or edges) in each cluster needs to equal the set of all vertices in the graph.
Constructor Summary | |
ClusterSet(Graph underlyingGraph)
Creates a new instance. |
Method Summary | |
void |
addCluster(java.util.Set elements)
Adds a new cluster to the collection. |
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(UserDataContainer element)
Given a vertex (or edge), retrieves the clusters which that vertex (or edge) belongs to if any |
Graph |
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. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ClusterSet(Graph underlyingGraph)
Method Detail |
public void addCluster(java.util.Set elements)
elements
- the set of vertices (or edges) comprising a component to be addedpublic abstract Graph getClusterAsNewSubGraph(int index)
index
- the position index of the cluster in the collection
public abstract ClusterSet createEquivalentClusterSet(Graph anotherGraph)
anotherGraph
- another graph whose corresponding clusters are to be retrieved
public java.util.Set getClusters(UserDataContainer 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 Graph getUnderlyingGraph()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |