com.phoenixst.plexus.util
public class SynchronizedGraph extends Object implements ObservableGraph, Serializable
Graph. It is the user's
responsibility to manually synchronize when iterating over the
Graph. This Graph will be serializable
if the delegate Graph is serializable. Note that the
Edge objects are not wrapped,
and are therefore not synchronized. As with
synchronized collections, iterators are also not synchronized.
Since: 1.0
Version: $Revision: 1.5 $
| Constructor Summary | |
|---|---|
| SynchronizedGraph(Graph delegate)
Creates a synchronized view of the specified
Graph. | |
| SynchronizedGraph(Graph delegate, Object mutex)
Creates a synchronized view of the specified
Graph and synchronized upon the specified object.
| |
| Method Summary | |
|---|---|
| Graph.Edge | addEdge(Object object, Object tail, Object head, boolean isDirected) |
| void | addGraphListener(GraphListener listener) |
| boolean | addNode(Object node) |
| Collection | adjacentNodes(Object node, Predicate traverserPredicate) |
| boolean | containsEdge(Graph.Edge edge) |
| boolean | containsNode(Object node) |
| int | degree(Object node) |
| int | degree(Object node, Predicate traverserPredicate) |
| Collection | edges(Predicate edgePredicate) |
| Object | getAdjacentNode(Object node, Predicate traverserPredicate) |
| Graph.Edge | getEdge(Predicate edgePredicate) |
| Graph.Edge | getIncidentEdge(Object node, Predicate traverserPredicate) |
| Object | getNode(Predicate nodePredicate) |
| Collection | incidentEdges(Object node, Predicate traverserPredicate) |
| Collection | nodes(Predicate nodePredicate) |
| boolean | removeEdge(Graph.Edge edge) |
| void | removeGraphListener(GraphListener listener) |
| boolean | removeNode(Object node) |
| String | toString() |
| Traverser | traverser(Object node, Predicate traverserPredicate) |
Graph. It is the user's responsibility to
manually synchronize on the created Graph when
iterating over it. This Graph will be
serializable if the specified Graph is
serializable.
Parameters: delegate the Graph for which a synchronized
view is to be created.
Graph and synchronized upon the specified object.
It is the user's responsibility to manually synchronize on
mutex when iterating over the Graph.
This Graph will be serializable if the specified
Graph is serializable.
Parameters: delegate the Graph for which a synchronized
view is to be created.
mutex the object upon which to synchronize access.