Package pascal.taie.util.graph
Class SimpleGraph<N>
java.lang.Object
pascal.taie.util.graph.SimpleGraph<N>
- Type Parameters:
N
- type of nodes
- All Implemented Interfaces:
Serializable
,Iterable<N>
,Graph<N>
A simple map-based implementation of
Graph
.- See Also:
-
Constructor Summary
ConstructorDescriptionConstructs an empty graph.SimpleGraph
(Graph<N> graph) Constructs a new graph containing the same node and edge sets as the specified graph. -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
int
getInDegreeOf
(N node) getNodes()
getPredsOf
(N node) getSuccsOf
(N node) void
removeEdge
(N source, N target) Removes an edge from this graph.void
removeNode
(N node) Removes a node from this graph.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface pascal.taie.util.graph.Graph
getInEdgesOf, getNumberOfNodes, getOutDegreeOf, getOutEdgesOf, hasEdge, hasEdge, hasNode, iterator
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
SimpleGraph
public SimpleGraph()Constructs an empty graph. -
SimpleGraph
Constructs a new graph containing the same node and edge sets as the specified graph.
-
-
Method Details
-
addNode
-
addEdge
-
removeNode
Removes a node from this graph. All edges from/to the node will also be removed. -
removeEdge
Removes an edge from this graph. -
getPredsOf
- Specified by:
getPredsOf
in interfaceGraph<N>
- Returns:
- the predecessors of given node in this graph.
-
getSuccsOf
- Specified by:
getSuccsOf
in interfaceGraph<N>
- Returns:
- the successors of given node in this graph.
-
getInDegreeOf
- Specified by:
getInDegreeOf
in interfaceGraph<N>
- Returns:
- the number of in edges of the given node.
-
getNodes
-