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>,java.lang.Iterable<T>
public class ExtensionGraph<T> extends java.lang.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(T n)intgetMaxNumber()TgetNode(int number)intgetNumber(T N)intgetNumberOfNodes()intgetPredNodeCount(T n)Return the number ofimmediate predecessornodes of nIntSetgetPredNodeNumbers(T node)java.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 GraphIntSetgetSuccNodeNumbers(T node)java.util.Iterator<T>getSuccNodes(T n)Return an Iterator over the immediate successor nodes of nbooleanhasEdge(T src, T dst)java.util.Iterator<T>iterateNodes(IntSet s)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)
-
-
-
Constructor Detail
-
ExtensionGraph
public ExtensionGraph(NumberedGraph<T> original)
-
-
Method Detail
-
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
-
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 java.lang.UnsupportedOperationException
Description copied from interface:NodeManagerremove a node from this graph- Specified by:
removeNodein interfaceNodeManager<T>- Throws:
java.lang.UnsupportedOperationException
-
containsNode
public boolean containsNode(T n)
- Specified by:
containsNodein interfaceNodeManager<T>- Returns:
- true iff the graph contains the specified node
-
getNumber
public int getNumber(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 java.util.Iterator<T> iterateNodes(IntSet s)
- Specified by:
iterateNodesin interfaceNumberedNodeManager<T>- Returns:
- iterator of nodes with the numbers in set s
-
getPredNodes
public java.util.Iterator<T> getPredNodes(T n)
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.
-
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(T node)
- Specified by:
getPredNodeNumbersin interfaceNumberedEdgeManager<T>- Returns:
- the numbers identifying the immediate predecessors of node
-
getSuccNodes
public java.util.Iterator<T> getSuccNodes(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(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 java.lang.UnsupportedOperationException
- Specified by:
removeEdgein interfaceEdgeManager<T>- Throws:
java.lang.UnsupportedOperationException
-
removeAllIncidentEdges
public void removeAllIncidentEdges(T node) throws java.lang.UnsupportedOperationException
- Specified by:
removeAllIncidentEdgesin interfaceEdgeManager<T>- Throws:
java.lang.UnsupportedOperationException
-
removeIncomingEdges
public void removeIncomingEdges(T node) throws java.lang.UnsupportedOperationException
- Specified by:
removeIncomingEdgesin interfaceEdgeManager<T>- Throws:
java.lang.UnsupportedOperationException
-
removeOutgoingEdges
public void removeOutgoingEdges(T node) throws java.lang.UnsupportedOperationException
- Specified by:
removeOutgoingEdgesin interfaceEdgeManager<T>- Throws:
java.lang.UnsupportedOperationException
-
hasEdge
public boolean hasEdge(T src, T dst)
- Specified by:
hasEdgein interfaceEdgeManager<T>
-
removeNodeAndEdges
public void removeNodeAndEdges(T n) throws java.lang.UnsupportedOperationException
Description copied from interface:Graphremove a node and all its incident edges- Specified by:
removeNodeAndEdgesin interfaceGraph<T>- Throws:
java.lang.UnsupportedOperationException- if the graph implementation does not allow removal
-
-