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 void
addEdge(T src, T dst)
void
addNode(T n)
add a node to this graphboolean
containsNode(T n)
int
getMaxNumber()
T
getNode(int number)
int
getNumber(T N)
int
getNumberOfNodes()
int
getPredNodeCount(T n)
Return the number ofimmediate predecessor
nodes of nIntSet
getPredNodeNumbers(T node)
java.util.Iterator<T>
getPredNodes(T n)
Return anIterator
over the immediate predecessor nodes of n This method never returnsnull
.int
getSuccNodeCount(T N)
Return the number ofimmediate successor
nodes of this Node in the GraphIntSet
getSuccNodeNumbers(T node)
java.util.Iterator<T>
getSuccNodes(T n)
Return an Iterator over the immediate successor nodes of nboolean
hasEdge(T src, T dst)
java.util.Iterator<T>
iterateNodes(IntSet s)
java.util.Iterator<T>
iterator()
void
removeAllIncidentEdges(T node)
void
removeEdge(T src, T dst)
void
removeIncomingEdges(T node)
void
removeNode(T n)
remove a node from this graphvoid
removeNodeAndEdges(T n)
remove a node and all its incident edgesvoid
removeOutgoingEdges(T node)
-
-
-
Constructor Detail
-
ExtensionGraph
public ExtensionGraph(NumberedGraph<T> original)
-
-
Method Detail
-
iterator
public java.util.Iterator<T> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<T>
- Specified by:
iterator
in interfaceNodeManager<T>
- Returns:
- an
Iterator
of the nodes in this graph
-
getNumberOfNodes
public int getNumberOfNodes()
- Specified by:
getNumberOfNodes
in interfaceNodeManager<T>
- Returns:
- the number of nodes in this graph
-
addNode
public void addNode(T n)
Description copied from interface:NodeManager
add a node to this graph- Specified by:
addNode
in interfaceNodeManager<T>
-
removeNode
public void removeNode(T n) throws java.lang.UnsupportedOperationException
Description copied from interface:NodeManager
remove a node from this graph- Specified by:
removeNode
in interfaceNodeManager<T>
- Throws:
java.lang.UnsupportedOperationException
-
containsNode
public boolean containsNode(T n)
- Specified by:
containsNode
in interfaceNodeManager<T>
- Returns:
- true iff the graph contains the specified node
-
getNumber
public int getNumber(T N)
- Specified by:
getNumber
in interfaceNumberedNodeManager<T>
-
getNode
public T getNode(int number)
- Specified by:
getNode
in interfaceNumberedNodeManager<T>
-
getMaxNumber
public int getMaxNumber()
- Specified by:
getMaxNumber
in interfaceNumberedNodeManager<T>
-
iterateNodes
public java.util.Iterator<T> iterateNodes(IntSet s)
- Specified by:
iterateNodes
in 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:EdgeManager
Return anIterator
over the immediate predecessor nodes of n This method never returnsnull
.- Specified by:
getPredNodes
in interfaceEdgeManager<T>
- Returns:
- an
Iterator
over the immediate predecessor nodes of this Node.
-
getPredNodeCount
public int getPredNodeCount(T n)
Description copied from interface:EdgeManager
Return the number ofimmediate predecessor
nodes of n- Specified by:
getPredNodeCount
in interfaceEdgeManager<T>
- Returns:
- the number of immediate predecessors of n.
-
getPredNodeNumbers
public IntSet getPredNodeNumbers(T node)
- Specified by:
getPredNodeNumbers
in interfaceNumberedEdgeManager<T>
- Returns:
- the numbers identifying the immediate predecessors of node
-
getSuccNodes
public java.util.Iterator<T> getSuccNodes(T n)
Description copied from interface:EdgeManager
Return an Iterator over the immediate successor nodes of nThis method never returns
null
.- Specified by:
getSuccNodes
in interfaceEdgeManager<T>
- Returns:
- an Iterator over the immediate successor nodes of n
-
getSuccNodeCount
public int getSuccNodeCount(T N)
Description copied from interface:EdgeManager
Return the number ofimmediate successor
nodes of this Node in the Graph- Specified by:
getSuccNodeCount
in interfaceEdgeManager<T>
- Returns:
- the number of immediate successor Nodes of this Node in the Graph.
-
getSuccNodeNumbers
public IntSet getSuccNodeNumbers(T node)
- Specified by:
getSuccNodeNumbers
in interfaceNumberedEdgeManager<T>
- Returns:
- the numbers identifying the immediate successors of node
-
addEdge
public void addEdge(T src, T dst)
- Specified by:
addEdge
in interfaceEdgeManager<T>
-
removeEdge
public void removeEdge(T src, T dst) throws java.lang.UnsupportedOperationException
- Specified by:
removeEdge
in interfaceEdgeManager<T>
- Throws:
java.lang.UnsupportedOperationException
-
removeAllIncidentEdges
public void removeAllIncidentEdges(T node) throws java.lang.UnsupportedOperationException
- Specified by:
removeAllIncidentEdges
in interfaceEdgeManager<T>
- Throws:
java.lang.UnsupportedOperationException
-
removeIncomingEdges
public void removeIncomingEdges(T node) throws java.lang.UnsupportedOperationException
- Specified by:
removeIncomingEdges
in interfaceEdgeManager<T>
- Throws:
java.lang.UnsupportedOperationException
-
removeOutgoingEdges
public void removeOutgoingEdges(T node) throws java.lang.UnsupportedOperationException
- Specified by:
removeOutgoingEdges
in interfaceEdgeManager<T>
- Throws:
java.lang.UnsupportedOperationException
-
hasEdge
public boolean hasEdge(T src, T dst)
- Specified by:
hasEdge
in interfaceEdgeManager<T>
-
removeNodeAndEdges
public void removeNodeAndEdges(T n) throws java.lang.UnsupportedOperationException
Description copied from interface:Graph
remove a node and all its incident edges- Specified by:
removeNodeAndEdges
in interfaceGraph<T>
- Throws:
java.lang.UnsupportedOperationException
- if the graph implementation does not allow removal
-
-