org._3pq.jgrapht.graph
Class GraphDelegator
- Graph, Serializable
public class GraphDelegator
implements Graph, Serializable
A graph backed by the the graph specified at the constructor, which
delegates all its methods to the backing graph. Operations on this graph
"pass through" to the to the backing graph. Any modification made to this
graph or the backing graph is reflected by the other.
This graph does
not pass the hashCode and equals operations through
to the backing graph, but relies on
Object's
equals and
hashCode methods.
This class is mostly used as a base for extending subclasses.
GraphDelegator
public GraphDelegator(Graph g)
Constructor for GraphDelegator.
g
- the backing graph (the delegate).
addEdge
public Edge addEdge(Object sourceVertex,
Object targetVertex)
- addEdge in interface Graph
addVertex
public boolean addVertex(Object v)
- addVertex in interface Graph
degreeOf
public int degreeOf(Object vertex)
edgesOf
public List edgesOf(Object vertex)
- edgesOf in interface Graph
getAllEdges
public List getAllEdges(Object sourceVertex,
Object targetVertex)
- getAllEdges in interface Graph
getEdge
public Edge getEdge(Object sourceVertex,
Object targetVertex)
- getEdge in interface Graph
inDegreeOf
public int inDegreeOf(Object vertex)
incomingEdgesOf
public List incomingEdgesOf(Object vertex)
outDegreeOf
public int outDegreeOf(Object vertex)
outgoingEdgesOf
public List outgoingEdgesOf(Object vertex)
removeEdge
public Edge removeEdge(Object sourceVertex,
Object targetVertex)
- removeEdge in interface Graph