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
ConstructorsConstructorDescriptionConstructs 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 TypeMethodDescriptionvoidvoidintgetInDegreeOf(N node) getNodes()getPredsOf(N node) getSuccsOf(N node) voidremoveEdge(N source, N target) Removes an edge from this graph.voidremoveNode(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, waitMethods inherited from interface pascal.taie.util.graph.Graph
getInEdgesOf, getNumberOfNodes, getOutDegreeOf, getOutEdgesOf, hasEdge, hasEdge, hasNode, iteratorMethods 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:
getPredsOfin interfaceGraph<N>- Returns:
- the predecessors of given node in this graph.
-
getSuccsOf
- Specified by:
getSuccsOfin interfaceGraph<N>- Returns:
- the successors of given node in this graph.
-
getInDegreeOf
- Specified by:
getInDegreeOfin interfaceGraph<N>- Returns:
- the number of in edges of the given node.
-
getNodes
-