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>,Iterable<T>
public class DelegatingGraph<T> extends 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(@Nullable T N)intgetNumberOfNodes()intgetPredNodeCount(T N)Return the number ofimmediate predecessornodes of nIterator<T>getPredNodes(@Nullable T N)Return anIteratorover the immediate predecessor nodes of nintgetSuccNodeCount(T N)Return the number ofimmediate successornodes of this Node in the GraphIterator<T>getSuccNodes(@Nullable T N)Return an Iterator over the immediate successor nodes of nbooleanhasEdge(@Nullable T src, @Nullable T dst)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)Stream<T>stream()StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
addEdge
public void addEdge(T src, T dst) throws IllegalArgumentException
- Specified by:
addEdgein interfaceEdgeManager<T>- Throws:
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(@Nullable 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
-
getPredNodeCount
public int getPredNodeCount(T N) throws 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:
IllegalArgumentException
-
getPredNodes
public Iterator<T> getPredNodes(@Nullable T N) throws IllegalArgumentException
Description copied from interface:EdgeManagerReturn anIteratorover the immediate predecessor nodes of nThis method never returns
null.- Specified by:
getPredNodesin interfaceEdgeManager<T>- Returns:
- an
Iteratorover the immediate predecessor nodes of this Node. - Throws:
IllegalArgumentException
-
getSuccNodeCount
public int getSuccNodeCount(T N) throws 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:
IllegalArgumentException
-
getSuccNodes
public Iterator<T> getSuccNodes(@Nullable T N) throws 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:
IllegalArgumentException
-
hasEdge
public boolean hasEdge(@Nullable T src, @Nullable T dst)
- Specified by:
hasEdgein interfaceEdgeManager<T>
-
stream
public Stream<T> stream()
- Specified by:
streamin interfaceNodeManager<T>- Returns:
- a
Streamof the nodes in this graph
-
removeAllIncidentEdges
public void removeAllIncidentEdges(T node) throws IllegalArgumentException
- Specified by:
removeAllIncidentEdgesin interfaceEdgeManager<T>- Throws:
IllegalArgumentException
-
removeEdge
public void removeEdge(T src, T dst) throws IllegalArgumentException
- Specified by:
removeEdgein interfaceEdgeManager<T>- Throws:
IllegalArgumentException
-
removeIncomingEdges
public void removeIncomingEdges(T node) throws IllegalArgumentException
- Specified by:
removeIncomingEdgesin interfaceEdgeManager<T>- Throws:
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 IllegalArgumentException
Description copied from interface:Graphremove a node and all its incident edges- Specified by:
removeNodeAndEdgesin interfaceGraph<T>- Throws:
IllegalArgumentException
-
removeOutgoingEdges
public void removeOutgoingEdges(T node) throws IllegalArgumentException
- Specified by:
removeOutgoingEdgesin interfaceEdgeManager<T>- Throws:
IllegalArgumentException
-
-