com.phoenixst.plexus
public class GraphWrapper extends Object implements ObservableGraph
Graph
which wraps another. If the wrapped graph
does not implement ObservableGraph, then GraphWrapper and GraphWrapper with throw
UnsupportedOperationExceptions
. This class is
intended to be extended.
Since: 1.0
Version: $Revision: 1.69 $
Constructor Summary | |
---|---|
GraphWrapper(Graph delegate)
Creates a new GraphWrapper . | |
protected | GraphWrapper()
This constructor, together with initialize,
allows a subclass to initialize the internal state during
deserialization. |
Method Summary | |
---|---|
Graph.Edge | addEdge(Object object, Object tail, Object head, boolean isDirected) |
void | addGraphListener(GraphListener listener)
Adds the specified GraphListener which will be
notified whenever this ObservableGraph's
structure changes. |
boolean | addNode(Object node) |
Collection | adjacentNodes(Object node, Predicate traverserPredicate) |
boolean | containsEdge(Graph.Edge edge) |
boolean | containsNode(Object node) |
protected GraphWrapper.EdgeWrapper | createEdge(Graph.Edge edge)
Creates a wrapped Graph.Edge . |
int | degree(Object node) |
int | degree(Object node, Predicate traverserPredicate) |
Collection | edges(Predicate edgePredicate) |
Object | getAdjacentNode(Object node, Predicate traverserPredicate)
This implementation returns the other endpoint of the
Graph.Edge returned by getIncidentEdge if present, otherwise it
returns null . |
protected Graph | getDelegate()
Provides accesss to the internal state so it can be manually
serialized by a subclass's writeObject() method. |
Graph.Edge | getEdge(Predicate edgePredicate)
This implementation |
Graph.Edge | getIncidentEdge(Object node, Predicate traverserPredicate)
This implementation |
Object | getNode(Predicate nodePredicate)
This implementation |
Collection | incidentEdges(Object node, Predicate traverserPredicate) |
protected void | initialize(Graph delegateGraph)
This method should only be called by subclasses during
deserialization. |
Collection | nodes(Predicate nodePredicate) |
boolean | removeEdge(Graph.Edge edge) |
void | removeGraphListener(GraphListener listener)
Removes a previously added GraphListener . |
boolean | removeNode(Object node) |
Traverser | traverser(Object node, Predicate traverserPredicate)
This implementation |
protected Object | unwrapEdgeObject(Object edgeObject)
Returns an unwrapped edge Object. |
protected Object | unwrapNode(Object node)
Returns an unwrapped node. |
protected Object | wrapEdgeObject(Object edgeObject)
Returns a wrapped edge Object. |
protected Predicate | wrapEdgePredicate(Predicate edgePredicate)
Returns a wrapped edge predicate, if necessary. |
protected Object | wrapNode(Object node)
Returns a wrapped node. |
protected Predicate | wrapNodePredicate(Predicate nodePredicate)
Returns a wrapped node predicate, if necessary. |
protected Traverser | wrapTraverser(Traverser traverser)
Returns a wrapped traverser. |
protected Predicate | wrapTraverserPredicate(Predicate traverserPredicate)
Returns a wrapped traverser predicate, if necessary. |
GraphWrapper
.GraphListener
which will be
notified whenever this ObservableGraph's
structure changes. If the wrapped graph does not implement
ObservableGraph, then this method with throw an
UnsupportedOperationException
.Graph.Edge
.Graph.Edge
returned by getIncidentEdge if present, otherwise it
returns null
.writeObject()
method.GraphListener
. If the
wrapped graph does not implement ObservableGraph, then
this method with throw an
UnsupportedOperationException
.