Package com.ibm.wala.util.graph.impl
Class ExtensionGraph<T>
- java.lang.Object
-
- com.ibm.wala.util.graph.impl.ExtensionGraph<T>
-
- All Implemented Interfaces:
EdgeManager<T>,Graph<T>,NodeManager<T>,NumberedEdgeManager<T>,NumberedGraph<T>,NumberedNodeManager<T>,Iterable<T>
public class ExtensionGraph<T> extends Object implements NumberedGraph<T>
-
-
Constructor Summary
Constructors Constructor Description ExtensionGraph(NumberedGraph<T> original)
-
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)intgetMaxNumber()TgetNode(int number)intgetNumber(@Nullable T N)intgetNumberOfNodes()intgetPredNodeCount(T n)Return the number ofimmediate predecessornodes of nIntSetgetPredNodeNumbers(@Nullable T node)Iterator<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 GraphIntSetgetSuccNodeNumbers(@Nullable T node)Iterator<T>getSuccNodes(@Nullable T n)Return an Iterator over the immediate successor nodes of nbooleanhasEdge(@Nullable T src, @Nullable T dst)Iterator<T>iterateNodes(IntSet s)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()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
ExtensionGraph
public ExtensionGraph(NumberedGraph<T> original)
-
-
Method Detail
-
stream
public Stream<T> stream()
- Specified by:
streamin interfaceNodeManager<T>- Returns:
- a
Streamof the nodes in this graph
-
getNumberOfNodes
public int getNumberOfNodes()
- Specified by:
getNumberOfNodesin interfaceNodeManager<T>- Returns:
- the number of nodes in this graph
-
addNode
public void addNode(T n)
Description copied from interface:NodeManageradd a node to this graph- Specified by:
addNodein interfaceNodeManager<T>
-
removeNode
public void removeNode(T n) throws UnsupportedOperationException
Description copied from interface:NodeManagerremove a node from this graph- Specified by:
removeNodein interfaceNodeManager<T>- Throws:
UnsupportedOperationException
-
containsNode
public boolean containsNode(@Nullable T n)
- Specified by:
containsNodein interfaceNodeManager<T>- Returns:
- true iff the graph contains the specified node
-
getNumber
public int getNumber(@Nullable T N)
- Specified by:
getNumberin interfaceNumberedNodeManager<T>
-
getNode
public T getNode(int number)
- Specified by:
getNodein interfaceNumberedNodeManager<T>
-
getMaxNumber
public int getMaxNumber()
- Specified by:
getMaxNumberin interfaceNumberedNodeManager<T>
-
iterateNodes
public Iterator<T> iterateNodes(IntSet s)
- Specified by:
iterateNodesin interfaceNumberedNodeManager<T>- Returns:
- iterator of nodes with the numbers in set s
-
getPredNodes
public Iterator<T> getPredNodes(@Nullable T n)
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.
-
getPredNodeCount
public int getPredNodeCount(T n)
Description copied from interface:EdgeManagerReturn the number ofimmediate predecessornodes of n- Specified by:
getPredNodeCountin interfaceEdgeManager<T>- Returns:
- the number of immediate predecessors of n.
-
getPredNodeNumbers
public IntSet getPredNodeNumbers(@Nullable T node)
- Specified by:
getPredNodeNumbersin interfaceNumberedEdgeManager<T>- Returns:
- the numbers identifying the immediate predecessors of node
-
getSuccNodes
public Iterator<T> getSuccNodes(@Nullable T n)
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
-
getSuccNodeCount
public int getSuccNodeCount(T N)
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.
-
getSuccNodeNumbers
public IntSet getSuccNodeNumbers(@Nullable T node)
- Specified by:
getSuccNodeNumbersin interfaceNumberedEdgeManager<T>- Returns:
- the numbers identifying the immediate successors of node
-
addEdge
public void addEdge(T src, T dst)
- Specified by:
addEdgein interfaceEdgeManager<T>
-
removeEdge
public void removeEdge(T src, T dst) throws UnsupportedOperationException
- Specified by:
removeEdgein interfaceEdgeManager<T>- Throws:
UnsupportedOperationException
-
removeAllIncidentEdges
public void removeAllIncidentEdges(T node) throws UnsupportedOperationException
- Specified by:
removeAllIncidentEdgesin interfaceEdgeManager<T>- Throws:
UnsupportedOperationException
-
removeIncomingEdges
public void removeIncomingEdges(T node) throws UnsupportedOperationException
- Specified by:
removeIncomingEdgesin interfaceEdgeManager<T>- Throws:
UnsupportedOperationException
-
removeOutgoingEdges
public void removeOutgoingEdges(T node) throws UnsupportedOperationException
- Specified by:
removeOutgoingEdgesin interfaceEdgeManager<T>- Throws:
UnsupportedOperationException
-
hasEdge
public boolean hasEdge(@Nullable T src, @Nullable T dst)
- Specified by:
hasEdgein interfaceEdgeManager<T>
-
removeNodeAndEdges
public void removeNodeAndEdges(T n) throws UnsupportedOperationException
Description copied from interface:Graphremove a node and all its incident edges- Specified by:
removeNodeAndEdgesin interfaceGraph<T>- Throws:
UnsupportedOperationException- if the graph implementation does not allow removal
-
-