N - L - public class HashMutableEdgeLabelledDirectedGraph<N,L> extends Object implements MutableEdgeLabelledDirectedGraph<N,L>
| Modifier and Type | Field and Description |
|---|---|
protected Map<soot.toolkits.graph.HashMutableEdgeLabelledDirectedGraph.DGEdge<N>,List<L>> |
edgeToLabels |
protected Set<N> |
heads |
protected Map<L,List<soot.toolkits.graph.HashMutableEdgeLabelledDirectedGraph.DGEdge<N>>> |
labelToEdges |
protected Map<N,List<N>> |
nodeToPreds |
protected Map<N,List<N>> |
nodeToSuccs |
protected Set<N> |
tails |
| Constructor and Description |
|---|
HashMutableEdgeLabelledDirectedGraph() |
| Modifier and Type | Method and Description |
|---|---|
void |
addEdge(N from,
N to,
L label)
Adds an edge to the graph between 2 nodes.
|
void |
addNode(N node)
Adds a node to the graph.
|
void |
clearAll()
Removes all nodes and edges.
|
HashMutableEdgeLabelledDirectedGraph<N,L> |
clone() |
boolean |
containsAnyEdge(L label) |
boolean |
containsAnyEdge(N from,
N to) |
boolean |
containsEdge(N from,
N to,
L label) |
boolean |
containsNode(N node) |
MutableDirectedGraph<N> |
getEdgesForLabel(L label)
Returns a DirectedGraph consisting of all edges with the given label and their nodes.
|
List<N> |
getHeads()
Returns a list of entry points for this graph.
|
List<L> |
getLabelsForEdges(N from,
N to)
Returns a list of labels for which an edge exists between from and to
|
List<N> |
getPredsOf(N s)
Returns a list of predecessors for the given node in the graph.
|
List<N> |
getSuccsOf(N s)
Returns a list of successors for the given node in the graph.
|
List<N> |
getTails()
Returns a list of exit points for this graph.
|
Iterator<N> |
iterator()
Returns an iterator for the nodes in this graph.
|
void |
printGraph() |
void |
removeAllEdges(L label)
Removes all edges with the given label in the graph.
|
void |
removeAllEdges(N from,
N to)
Removes all edges between 2 nodes in the graph.
|
void |
removeEdge(N from,
N to,
L label)
Removes an edge between 2 nodes in the graph.
|
void |
removeNode(N node)
Removes a node from the graph.
|
int |
size()
Returns the node count for this graph.
|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorprotected Map<soot.toolkits.graph.HashMutableEdgeLabelledDirectedGraph.DGEdge<N>,List<L>> edgeToLabels
protected Map<L,List<soot.toolkits.graph.HashMutableEdgeLabelledDirectedGraph.DGEdge<N>>> labelToEdges
public HashMutableEdgeLabelledDirectedGraph()
public void clearAll()
public HashMutableEdgeLabelledDirectedGraph<N,L> clone()
public List<N> getHeads()
DirectedGraphgetHeads in interface DirectedGraph<N>public List<N> getTails()
DirectedGraphgetTails in interface DirectedGraph<N>public List<N> getPredsOf(N s)
DirectedGraphgetPredsOf in interface DirectedGraph<N>public List<N> getSuccsOf(N s)
DirectedGraphgetSuccsOf in interface DirectedGraph<N>public int size()
DirectedGraphsize in interface DirectedGraph<N>public Iterator<N> iterator()
DirectedGraphpublic void addEdge(N from, N to, L label)
MutableEdgeLabelledDirectedGraphaddEdge in interface MutableEdgeLabelledDirectedGraph<N,L>from - out node for the edge.to - in node for the edge.label - label for the edge.public List<L> getLabelsForEdges(N from, N to)
EdgeLabelledDirectedGraphgetLabelsForEdges in interface EdgeLabelledDirectedGraph<N,L>from - out node of the edges to get labels forto - in node of the edges to get labels forpublic MutableDirectedGraph<N> getEdgesForLabel(L label)
EdgeLabelledDirectedGraphgetEdgesForLabel in interface EdgeLabelledDirectedGraph<N,L>label - edge label to use as a filter in building the subgraphpublic void removeEdge(N from, N to, L label)
MutableEdgeLabelledDirectedGraphremoveEdge in interface MutableEdgeLabelledDirectedGraph<N,L>from - out node for the edges to remove.to - in node for the edges to remove.label - label for the edge to remove.public void removeAllEdges(N from, N to)
MutableEdgeLabelledDirectedGraphremoveAllEdges in interface MutableEdgeLabelledDirectedGraph<N,L>from - out node for the edges to remove.to - in node for the edges to remove.public void removeAllEdges(L label)
MutableEdgeLabelledDirectedGraphremoveAllEdges in interface MutableEdgeLabelledDirectedGraph<N,L>label - label for the edge to remove.public boolean containsEdge(N from, N to, L label)
containsEdge in interface EdgeLabelledDirectedGraph<N,L>public boolean containsAnyEdge(N from, N to)
containsAnyEdge in interface EdgeLabelledDirectedGraph<N,L>from - out node for the edgesto - in node for the edgespublic boolean containsAnyEdge(L label)
containsAnyEdge in interface EdgeLabelledDirectedGraph<N,L>label - label for the edgespublic boolean containsNode(N node)
containsNode in interface EdgeLabelledDirectedGraph<N,L>node - node that we want to know if the graph containspublic void addNode(N node)
MutableEdgeLabelledDirectedGraphaddNode in interface MutableEdgeLabelledDirectedGraph<N,L>node - a node to add to the graph.DirectedGraph.getHeads(),
DirectedGraph.getTails()public void removeNode(N node)
MutableEdgeLabelledDirectedGraphremoveNode in interface MutableEdgeLabelledDirectedGraph<N,L>node - the node to be removed.public void printGraph()
Copyright © 2020 Soot OSS. All rights reserved.