|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.progeeks.graph.CacheGraph
public class CacheGraph
A graph implementation that delegates to a supplied graph and caches any accessed nodes/edges in a DefaultGraph. Note that nodes cannot be Predicates in this Graph implementation.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.phoenixst.plexus.Graph |
|---|
com.phoenixst.plexus.Graph.Edge |
| Constructor Summary | |
|---|---|
CacheGraph()
|
|
| Method Summary | |
|---|---|
com.phoenixst.plexus.Graph.Edge |
addEdge(java.lang.Object object,
java.lang.Object tail,
java.lang.Object head,
boolean isDirected)
|
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)
|
protected com.phoenixst.plexus.Graph.Edge |
cacheEdge(com.phoenixst.plexus.Graph.Edge edge)
Caches the specified main graph edge by converting it to a cache edge and making sure the nodes are cached. |
boolean |
containsEdge(com.phoenixst.plexus.Graph.Edge edge)
|
boolean |
containsNode(java.lang.Object node)
|
int |
degree(java.lang.Object node)
|
int |
degree(java.lang.Object node,
org.apache.commons.collections.Predicate traverserPredicate)
|
java.util.Collection |
edges(org.apache.commons.collections.Predicate edgePredicate)
|
java.lang.Object |
getAdjacentNode(java.lang.Object node,
org.apache.commons.collections.Predicate traverserPredicate)
|
protected com.phoenixst.plexus.Graph.Edge |
getCachedEdgeForGraphEdge(com.phoenixst.plexus.Graph.Edge edge)
|
com.phoenixst.plexus.Graph.Edge |
getEdge(org.apache.commons.collections.Predicate edgePredicate)
|
com.phoenixst.plexus.Graph |
getGraph()
|
protected com.phoenixst.plexus.Graph.Edge |
getGraphEdgeForCacheEdge(com.phoenixst.plexus.Graph.Edge edge)
|
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)
|
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)
|
void |
setGraph(com.phoenixst.plexus.Graph graph)
|
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, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CacheGraph()
| Method Detail |
|---|
public void setGraph(com.phoenixst.plexus.Graph graph)
public com.phoenixst.plexus.Graph getGraph()
public int degree(java.lang.Object node)
degree in interface com.phoenixst.plexus.Graph
public int degree(java.lang.Object node,
org.apache.commons.collections.Predicate traverserPredicate)
degree in interface com.phoenixst.plexus.Graphpublic boolean addNode(java.lang.Object node)
addNode in interface com.phoenixst.plexus.Graphpublic boolean removeNode(java.lang.Object node)
removeNode in interface com.phoenixst.plexus.Graphpublic boolean containsNode(java.lang.Object node)
containsNode in interface com.phoenixst.plexus.Graph
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.Graphprotected com.phoenixst.plexus.Graph.Edge cacheEdge(com.phoenixst.plexus.Graph.Edge edge)
protected com.phoenixst.plexus.Graph.Edge getGraphEdgeForCacheEdge(com.phoenixst.plexus.Graph.Edge edge)
protected com.phoenixst.plexus.Graph.Edge getCachedEdgeForGraphEdge(com.phoenixst.plexus.Graph.Edge edge)
public boolean removeEdge(com.phoenixst.plexus.Graph.Edge edge)
removeEdge in interface com.phoenixst.plexus.Graphpublic boolean containsEdge(com.phoenixst.plexus.Graph.Edge edge)
containsEdge in interface com.phoenixst.plexus.Graphpublic java.util.Collection nodes(org.apache.commons.collections.Predicate nodePredicate)
nodes in interface com.phoenixst.plexus.Graphpublic java.util.Collection edges(org.apache.commons.collections.Predicate edgePredicate)
edges in interface com.phoenixst.plexus.Graph
public java.util.Collection adjacentNodes(java.lang.Object node,
org.apache.commons.collections.Predicate traverserPredicate)
adjacentNodes in interface com.phoenixst.plexus.Graph
public java.util.Collection incidentEdges(java.lang.Object node,
org.apache.commons.collections.Predicate traverserPredicate)
incidentEdges in interface com.phoenixst.plexus.Graphpublic java.lang.Object getNode(org.apache.commons.collections.Predicate nodePredicate)
getNode in interface com.phoenixst.plexus.Graphpublic com.phoenixst.plexus.Graph.Edge getEdge(org.apache.commons.collections.Predicate edgePredicate)
getEdge in interface com.phoenixst.plexus.Graph
public java.lang.Object getAdjacentNode(java.lang.Object node,
org.apache.commons.collections.Predicate traverserPredicate)
getAdjacentNode in interface com.phoenixst.plexus.Graph
public com.phoenixst.plexus.Graph.Edge getIncidentEdge(java.lang.Object node,
org.apache.commons.collections.Predicate traverserPredicate)
getIncidentEdge in interface com.phoenixst.plexus.Graph
public com.phoenixst.plexus.Traverser traverser(java.lang.Object node,
org.apache.commons.collections.Predicate traverserPredicate)
traverser in interface com.phoenixst.plexus.Graphpublic 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.ObservableGraph
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||