Package com.ibm.wala.util.graph.impl
Class DelegatingGraph<T>
- java.lang.Object
-
- com.ibm.wala.util.graph.impl.DelegatingGraph<T>
-
- All Implemented Interfaces:
EdgeManager<T>,Graph<T>,NodeManager<T>,java.lang.Iterable<T>
public class DelegatingGraph<T> extends java.lang.Object implements Graph<T>
A utility class.
-
-
Constructor Summary
Constructors Constructor Description DelegatingGraph(Graph<T> delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEdge(T src, T dst)voidaddNode(T n)add a node to this graphbooleancontainsNode(T N)intgetNumberOfNodes()intgetPredNodeCount(T N)Return the number ofimmediate predecessornodes of njava.util.Iterator<T>getPredNodes(T N)Return anIteratorover the immediate predecessor nodes of n This method never returnsnull.intgetSuccNodeCount(T N)Return the number ofimmediate successornodes of this Node in the Graphjava.util.Iterator<T>getSuccNodes(T N)Return an Iterator over the immediate successor nodes of nbooleanhasEdge(T src, T dst)java.util.Iterator<T>iterator()voidremoveAllIncidentEdges(T node)voidremoveEdge(T src, T dst)voidremoveIncomingEdges(T node)voidremoveNode(T n)remove a node from this graphvoidremoveNodeAndEdges(T N)remove a node and all its incident edgesvoidremoveOutgoingEdges(T node)java.lang.StringtoString()
-
-
-
Method Detail
-
addEdge
public void addEdge(T src, T dst) throws java.lang.IllegalArgumentException
- Specified by:
addEdgein interfaceEdgeManager<T>- Throws:
java.lang.IllegalArgumentException
-
addNode
public void addNode(T n)
Description copied from interface:NodeManageradd a node to this graph- Specified by:
addNodein interfaceNodeManager<T>
-
containsNode
public boolean containsNode(T N)
- Specified by:
containsNodein interfaceNodeManager<T>- Returns:
- true iff the graph contains the specified node
-
getNumberOfNodes
public int getNumberOfNodes()
- Specified by:
getNumberOfNodesin interfaceNodeManager<T>- Returns:
- the number of nodes in this graph
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getPredNodeCount
public int getPredNodeCount(T N) throws java.lang.IllegalArgumentException
Description copied from interface:EdgeManagerReturn the number ofimmediate predecessornodes of n- Specified by:
getPredNodeCountin interfaceEdgeManager<T>- Returns:
- the number of immediate predecessors of n.
- Throws:
java.lang.IllegalArgumentException
-
getPredNodes
public java.util.Iterator<T> getPredNodes(T N) throws java.lang.IllegalArgumentException
Description copied from interface:EdgeManagerReturn anIteratorover the immediate predecessor nodes of n This method never returnsnull.- Specified by:
getPredNodesin interfaceEdgeManager<T>- Returns:
- an
Iteratorover the immediate predecessor nodes of this Node. - Throws:
java.lang.IllegalArgumentException
-
getSuccNodeCount
public int getSuccNodeCount(T N) throws java.lang.IllegalArgumentException
Description copied from interface:EdgeManagerReturn the number ofimmediate successornodes of this Node in the Graph- Specified by:
getSuccNodeCountin interfaceEdgeManager<T>- Returns:
- the number of immediate successor Nodes of this Node in the Graph.
- Throws:
java.lang.IllegalArgumentException
-
getSuccNodes
public java.util.Iterator<T> getSuccNodes(T N) throws java.lang.IllegalArgumentException
Description copied from interface:EdgeManagerReturn an Iterator over the immediate successor nodes of nThis method never returns
null.- Specified by:
getSuccNodesin interfaceEdgeManager<T>- Returns:
- an Iterator over the immediate successor nodes of n
- Throws:
java.lang.IllegalArgumentException
-
hasEdge
public boolean hasEdge(T src, T dst)
- Specified by:
hasEdgein interfaceEdgeManager<T>
-
iterator
public java.util.Iterator<T> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<T>- Specified by:
iteratorin interfaceNodeManager<T>- Returns:
- an
Iteratorof the nodes in this graph
-
removeAllIncidentEdges
public void removeAllIncidentEdges(T node) throws java.lang.IllegalArgumentException
- Specified by:
removeAllIncidentEdgesin interfaceEdgeManager<T>- Throws:
java.lang.IllegalArgumentException
-
removeEdge
public void removeEdge(T src, T dst) throws java.lang.IllegalArgumentException
- Specified by:
removeEdgein interfaceEdgeManager<T>- Throws:
java.lang.IllegalArgumentException
-
removeIncomingEdges
public void removeIncomingEdges(T node) throws java.lang.IllegalArgumentException
- Specified by:
removeIncomingEdgesin interfaceEdgeManager<T>- Throws:
java.lang.IllegalArgumentException
-
removeNode
public void removeNode(T n)
Description copied from interface:NodeManagerremove a node from this graph- Specified by:
removeNodein interfaceNodeManager<T>
-
removeNodeAndEdges
public void removeNodeAndEdges(T N) throws java.lang.IllegalArgumentException
Description copied from interface:Graphremove a node and all its incident edges- Specified by:
removeNodeAndEdgesin interfaceGraph<T>- Throws:
java.lang.IllegalArgumentException
-
removeOutgoingEdges
public void removeOutgoingEdges(T node) throws java.lang.IllegalArgumentException
- Specified by:
removeOutgoingEdgesin interfaceEdgeManager<T>- Throws:
java.lang.IllegalArgumentException
-
-