|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.phoenixst.plexus.AbstractGraph
org.progeeks.graph.CompositeGraph
public class CompositeGraph
Graph implementation that contains other graphs and links them together as one large unified graph. Facilities are built in that allow filters to be targetted to certain sub-graphs. Note: all node iteration and other access methods may return duplicate nodes since they don't correlate the different graphs during this process. It was thought that raw speed and memory reduction is better then perfect accuracy in this case.
| Nested Class Summary | |
|---|---|
static class |
CompositeGraph.GraphCoordinator
A coordinator can be associated with a subgraph to provide information about the types of filters that will return results and the types of nodes and edges that the graph accepts. |
| Nested classes/interfaces inherited from interface com.phoenixst.plexus.Graph |
|---|
com.phoenixst.plexus.Graph.Edge |
| Constructor Summary | |
|---|---|
|
CompositeGraph()
Creates a new CompositeGraph using an empty EdgeIdentityGraph as its root. |
protected |
CompositeGraph(com.phoenixst.plexus.Graph root)
Constructor that can be used by subclasses to customize the root graph implementation. |
| Method Summary | |
|---|---|
com.phoenixst.plexus.Graph.Edge |
addEdge(java.lang.Object object,
java.lang.Object tail,
java.lang.Object head,
boolean isDirected)
|
void |
addGraph(com.phoenixst.plexus.Graph graph)
|
void |
addGraph(com.phoenixst.plexus.Graph graph,
CompositeGraph.GraphCoordinator coordinator)
|
void |
addGraphListener(com.phoenixst.plexus.GraphListener listener)
Adds the specified GraphListener which will be
notified whenever this ObservableGraph's
structure changes. |
boolean |
addNode(java.lang.Object node)
|
java.util.Collection |
adjacentNodes(java.lang.Object node,
org.apache.commons.collections.Predicate traverserPredicate)
|
boolean |
containsEdge(com.phoenixst.plexus.Graph.Edge edge)
|
boolean |
containsNode(java.lang.Object node)
|
protected boolean |
containsNode(java.lang.Object node,
com.phoenixst.plexus.Graph skipGraph)
Returns true if a sub-graph contains the specified node other than the graph specified. |
int |
degree(java.lang.Object node)
|
int |
degree(java.lang.Object node,
org.apache.commons.collections.Predicate traverserPredicate)
|
protected java.util.Collection |
edges()
|
java.util.Collection |
edges(org.apache.commons.collections.Predicate edgePredicate)
|
java.lang.Object |
getAdjacentNode(java.lang.Object node,
org.apache.commons.collections.Predicate traverserPredicate)
|
com.phoenixst.plexus.Graph.Edge |
getEdge(org.apache.commons.collections.Predicate edgePredicate)
|
protected org.progeeks.graph.CompositeGraph.GraphEntry |
getFirstEntryForNode(java.lang.Object node)
Returns the first non-root entry that contains the node. |
protected com.phoenixst.plexus.Graph |
getGraphForEdge(java.lang.Object object,
java.lang.Object tail,
java.lang.Object head,
boolean isDirected)
Searches for an entry that is appropriate for an edge connecting both of the specified nodes. |
com.phoenixst.plexus.Graph.Edge |
getIncidentEdge(java.lang.Object node,
org.apache.commons.collections.Predicate traverserPredicate)
|
java.lang.Object |
getNode(org.apache.commons.collections.Predicate nodePredicate)
Returns a node from this graph that matches the specified filter. |
java.util.Collection |
incidentEdges(java.lang.Object node,
org.apache.commons.collections.Predicate traverserPredicate)
|
protected java.util.Collection |
nodes()
|
java.util.Collection |
nodes(org.apache.commons.collections.Predicate nodePredicate)
|
boolean |
removeEdge(com.phoenixst.plexus.Graph.Edge edge)
|
void |
removeGraphListener(com.phoenixst.plexus.GraphListener listener)
Removes a previously added GraphListener. |
boolean |
removeNode(java.lang.Object node)
|
java.lang.String |
toString()
|
protected com.phoenixst.plexus.Traverser |
traverser(java.lang.Object node)
|
com.phoenixst.plexus.Traverser |
traverser(java.lang.Object node,
org.apache.commons.collections.Predicate traverserPredicate)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CompositeGraph()
protected CompositeGraph(com.phoenixst.plexus.Graph root)
| Method Detail |
|---|
protected org.progeeks.graph.CompositeGraph.GraphEntry getFirstEntryForNode(java.lang.Object node)
public final void addGraph(com.phoenixst.plexus.Graph graph)
public final void addGraph(com.phoenixst.plexus.Graph graph,
CompositeGraph.GraphCoordinator coordinator)
protected java.util.Collection nodes()
nodes in class com.phoenixst.plexus.AbstractGraphprotected java.util.Collection edges()
edges in class com.phoenixst.plexus.AbstractGraphprotected com.phoenixst.plexus.Traverser traverser(java.lang.Object node)
traverser in class com.phoenixst.plexus.AbstractGraphpublic boolean addNode(java.lang.Object node)
addNode in interface com.phoenixst.plexus.GraphaddNode in class com.phoenixst.plexus.AbstractGraphpublic boolean removeNode(java.lang.Object node)
removeNode in interface com.phoenixst.plexus.GraphremoveNode in class com.phoenixst.plexus.AbstractGraphpublic boolean containsNode(java.lang.Object node)
containsNode in interface com.phoenixst.plexus.GraphcontainsNode in class com.phoenixst.plexus.AbstractGraph
protected boolean containsNode(java.lang.Object node,
com.phoenixst.plexus.Graph skipGraph)
protected com.phoenixst.plexus.Graph getGraphForEdge(java.lang.Object object,
java.lang.Object tail,
java.lang.Object head,
boolean isDirected)
public com.phoenixst.plexus.Graph.Edge addEdge(java.lang.Object object,
java.lang.Object tail,
java.lang.Object head,
boolean isDirected)
addEdge in interface com.phoenixst.plexus.GraphaddEdge in class com.phoenixst.plexus.AbstractGraphpublic boolean removeEdge(com.phoenixst.plexus.Graph.Edge edge)
removeEdge in interface com.phoenixst.plexus.GraphremoveEdge in class com.phoenixst.plexus.AbstractGraphpublic boolean containsEdge(com.phoenixst.plexus.Graph.Edge edge)
containsEdge in interface com.phoenixst.plexus.GraphcontainsEdge in class com.phoenixst.plexus.AbstractGraphpublic int degree(java.lang.Object node)
degree in interface com.phoenixst.plexus.Graphdegree in class com.phoenixst.plexus.AbstractGraph
public int degree(java.lang.Object node,
org.apache.commons.collections.Predicate traverserPredicate)
degree in interface com.phoenixst.plexus.Graphdegree in class com.phoenixst.plexus.AbstractGraphpublic java.util.Collection nodes(org.apache.commons.collections.Predicate nodePredicate)
nodes in interface com.phoenixst.plexus.Graphnodes in class com.phoenixst.plexus.AbstractGraphpublic java.util.Collection edges(org.apache.commons.collections.Predicate edgePredicate)
edges in interface com.phoenixst.plexus.Graphedges in class com.phoenixst.plexus.AbstractGraphpublic java.lang.Object getNode(org.apache.commons.collections.Predicate nodePredicate)
getNode in interface com.phoenixst.plexus.GraphgetNode in class com.phoenixst.plexus.AbstractGraphpublic com.phoenixst.plexus.Graph.Edge getEdge(org.apache.commons.collections.Predicate edgePredicate)
getEdge in interface com.phoenixst.plexus.GraphgetEdge in class com.phoenixst.plexus.AbstractGraph
public java.util.Collection adjacentNodes(java.lang.Object node,
org.apache.commons.collections.Predicate traverserPredicate)
adjacentNodes in interface com.phoenixst.plexus.GraphadjacentNodes in class com.phoenixst.plexus.AbstractGraph
public java.util.Collection incidentEdges(java.lang.Object node,
org.apache.commons.collections.Predicate traverserPredicate)
incidentEdges in interface com.phoenixst.plexus.GraphincidentEdges in class com.phoenixst.plexus.AbstractGraph
public java.lang.Object getAdjacentNode(java.lang.Object node,
org.apache.commons.collections.Predicate traverserPredicate)
getAdjacentNode in interface com.phoenixst.plexus.GraphgetAdjacentNode in class com.phoenixst.plexus.AbstractGraph
public com.phoenixst.plexus.Graph.Edge getIncidentEdge(java.lang.Object node,
org.apache.commons.collections.Predicate traverserPredicate)
getIncidentEdge in interface com.phoenixst.plexus.GraphgetIncidentEdge in class com.phoenixst.plexus.AbstractGraph
public com.phoenixst.plexus.Traverser traverser(java.lang.Object node,
org.apache.commons.collections.Predicate traverserPredicate)
traverser in interface com.phoenixst.plexus.Graphtraverser in class com.phoenixst.plexus.AbstractGraphpublic void addGraphListener(com.phoenixst.plexus.GraphListener listener)
GraphListener which will be
notified whenever this ObservableGraph's
structure changes.
addGraphListener in interface com.phoenixst.plexus.ObservableGraphpublic void removeGraphListener(com.phoenixst.plexus.GraphListener listener)
GraphListener.
removeGraphListener in interface com.phoenixst.plexus.ObservableGraphpublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||