|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectedu.uci.ics.jung.utils.SubsetManager
A class which allows users to create and maintain
Predicate-specified vertex and edge subsets.
The subsets are automatically maintained as vertices and
edges are added to, and removed from, the constructor-specified
graph.
A subset is created by providing a Predicate;
those graph elements that pass the predicate are added to the
subset.
| Method Summary | |
boolean |
addEdgeSubset(org.apache.commons.collections.Predicate p)
Creates an edge subset based on p. |
boolean |
addVertexSubset(org.apache.commons.collections.Predicate p)
Creates a vertex subset based on p. |
void |
edgeAdded(GraphEvent event)
Adds the edge whose event this is to all appropriate subsets. |
void |
edgeRemoved(GraphEvent event)
Removes the edge whose event this is from all appropriate subsets. |
java.util.Set |
getEdges(org.apache.commons.collections.Predicate p)
Returns the edge subset, if any, which this instance has defined based on p. |
static SubsetManager |
getInstance(ArchetypeGraph g)
Gets this graph's SubsetManager, creating it if necessary. |
java.util.Set |
getVertices(org.apache.commons.collections.Predicate p)
Returns the vertex subset, if any, which this instance has defined based on p. |
void |
removeEdgeSubset(org.apache.commons.collections.Predicate p)
Removes the edge subset based on p. |
void |
removeVertexSubset(org.apache.commons.collections.Predicate p)
Removes the vertex subset based on p. |
void |
vertexAdded(GraphEvent event)
Adds the vertex whose event this is to all appropriate subsets. |
void |
vertexRemoved(GraphEvent event)
Removes the vertex whose event this is from all appropriate subsets. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static SubsetManager getInstance(ArchetypeGraph g)
SubsetManager, creating it if necessary.
g - the graph whose subset manager is requestedpublic void vertexAdded(GraphEvent event)
vertexAdded in interface GraphEventListenerpublic void vertexRemoved(GraphEvent event)
vertexRemoved in interface GraphEventListenerpublic void edgeAdded(GraphEvent event)
edgeAdded in interface GraphEventListenerpublic void edgeRemoved(GraphEvent event)
edgeRemoved in interface GraphEventListenerpublic java.util.Set getVertices(org.apache.commons.collections.Predicate p)
p. If this instance has defined no such
subset, returns null.
p - the predicate which may define a subsetpublic java.util.Set getEdges(org.apache.commons.collections.Predicate p)
p. If this instance has defined no such
subset, returns null.
p - the predicate which may define a subsetpublic boolean addVertexSubset(org.apache.commons.collections.Predicate p)
p.
p - the predicate defining the subset
public boolean addEdgeSubset(org.apache.commons.collections.Predicate p)
p.
p - the predicate defining the subset
public void removeVertexSubset(org.apache.commons.collections.Predicate p)
p.
p - the predicate defining the subsetpublic void removeEdgeSubset(org.apache.commons.collections.Predicate p)
p.
p - the predicate defining the subset
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||