public class HashMutableEdgeLabelledDirectedGraph extends java.lang.Object implements MutableEdgeLabelledDirectedGraph
| Modifier and Type | Field and Description |
|---|---|
protected java.util.HashMap<soot.toolkits.graph.DGEdge,java.util.ArrayList<java.lang.Object>> |
edgeToLabels |
protected Chain |
heads |
protected java.util.HashMap<java.lang.Object,java.util.ArrayList<soot.toolkits.graph.DGEdge>> |
labelToEdges |
protected java.util.HashMap<java.lang.Object,java.util.ArrayList> |
nodeToPreds |
protected java.util.HashMap<java.lang.Object,java.util.ArrayList> |
nodeToSuccs |
protected Chain |
tails |
| Constructor and Description |
|---|
HashMutableEdgeLabelledDirectedGraph() |
| Modifier and Type | Method and Description |
|---|---|
void |
addEdge(java.lang.Object from,
java.lang.Object to,
java.lang.Object label)
Adds an edge to the graph between 2 nodes.
|
void |
addNode(java.lang.Object node)
Adds a node to the graph.
|
void |
clearAll()
Removes all nodes and edges.
|
java.lang.Object |
clone() |
boolean |
containsAnyEdge(java.lang.Object label) |
boolean |
containsAnyEdge(java.lang.Object from,
java.lang.Object to) |
boolean |
containsEdge(java.lang.Object from,
java.lang.Object to,
java.lang.Object label) |
boolean |
containsNode(java.lang.Object node) |
MutableDirectedGraph |
getEdgesForLabel(java.lang.Object label)
Returns a MutableDirectedGraph consisting of
all edges with the given label and their nodes.
|
java.util.List |
getHeads()
Returns a list of entry points for this graph.
|
java.util.List<java.lang.Object> |
getLabelsForEdges(java.lang.Object from,
java.lang.Object to)
Returns a list of labels for which an edge exists between from and to
|
java.util.List<java.lang.Object> |
getNodes() |
java.util.List |
getPredsOf(java.lang.Object s)
Returns a list of predecessors for the given node in the graph.
|
java.util.List |
getSuccsOf(java.lang.Object s)
Returns a list of successors for the given node in the graph.
|
java.util.List |
getTails()
Returns a list of exit points for this graph.
|
java.util.Iterator |
iterator()
Returns an iterator for the nodes in this graph.
|
void |
printGraph() |
void |
removeAllEdges(java.lang.Object label)
Removes all edges with the given label in the graph.
|
void |
removeAllEdges(java.lang.Object from,
java.lang.Object to)
Removes all edges between 2 nodes in the graph.
|
void |
removeEdge(java.lang.Object from,
java.lang.Object to,
java.lang.Object label)
Removes an edge between 2 nodes in the graph.
|
void |
removeNode(java.lang.Object node)
Removes a node from the graph.
|
int |
size()
Returns the node count for this graph.
|
protected java.util.HashMap<java.lang.Object,java.util.ArrayList> nodeToPreds
protected java.util.HashMap<java.lang.Object,java.util.ArrayList> nodeToSuccs
protected java.util.HashMap<soot.toolkits.graph.DGEdge,java.util.ArrayList<java.lang.Object>> edgeToLabels
protected java.util.HashMap<java.lang.Object,java.util.ArrayList<soot.toolkits.graph.DGEdge>> labelToEdges
protected Chain heads
protected Chain tails
public HashMutableEdgeLabelledDirectedGraph()
public void clearAll()
public java.lang.Object clone()
clone in class java.lang.Objectpublic java.util.List getHeads()
DirectedGraphgetHeads in interface DirectedGraphpublic java.util.List getTails()
DirectedGraphgetTails in interface DirectedGraphpublic java.util.List getPredsOf(java.lang.Object s)
DirectedGraphgetPredsOf in interface DirectedGraphpublic java.util.List getSuccsOf(java.lang.Object s)
DirectedGraphgetSuccsOf in interface DirectedGraphpublic int size()
DirectedGraphsize in interface DirectedGraphpublic java.util.Iterator iterator()
DirectedGraphiterator in interface java.lang.Iterableiterator in interface DirectedGraphpublic void addEdge(java.lang.Object from,
java.lang.Object to,
java.lang.Object label)
MutableEdgeLabelledDirectedGraphaddEdge in interface MutableEdgeLabelledDirectedGraphfrom - out node for the edge.to - in node for the edge.label - label for the edge.public java.util.List<java.lang.Object> getLabelsForEdges(java.lang.Object from,
java.lang.Object to)
MutableEdgeLabelledDirectedGraphgetLabelsForEdges in interface MutableEdgeLabelledDirectedGraphfrom - out node for the edges to remove.to - in node for the edges to remove.public MutableDirectedGraph getEdgesForLabel(java.lang.Object label)
MutableEdgeLabelledDirectedGraphgetEdgesForLabel in interface MutableEdgeLabelledDirectedGraphlabel - label for the edge to remove.public void removeEdge(java.lang.Object from,
java.lang.Object to,
java.lang.Object label)
MutableEdgeLabelledDirectedGraphremoveEdge in interface MutableEdgeLabelledDirectedGraphfrom - 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(java.lang.Object from,
java.lang.Object to)
MutableEdgeLabelledDirectedGraphremoveAllEdges in interface MutableEdgeLabelledDirectedGraphfrom - out node for the edges to remove.to - in node for the edges to remove.public void removeAllEdges(java.lang.Object label)
MutableEdgeLabelledDirectedGraphremoveAllEdges in interface MutableEdgeLabelledDirectedGraphlabel - label for the edge to remove.public boolean containsEdge(java.lang.Object from,
java.lang.Object to,
java.lang.Object label)
containsEdge in interface MutableEdgeLabelledDirectedGraphpublic boolean containsAnyEdge(java.lang.Object from,
java.lang.Object to)
containsAnyEdge in interface MutableEdgeLabelledDirectedGraphfrom - out node for the edges.to - in node for the edges.public boolean containsAnyEdge(java.lang.Object label)
containsAnyEdge in interface MutableEdgeLabelledDirectedGraphlabel - label for the edges.public boolean containsNode(java.lang.Object node)
containsNode in interface MutableEdgeLabelledDirectedGraphnode - node that we want to know if the graph constains.public java.util.List<java.lang.Object> getNodes()
getNodes in interface MutableEdgeLabelledDirectedGraphpublic void addNode(java.lang.Object node)
MutableEdgeLabelledDirectedGraphaddNode in interface MutableEdgeLabelledDirectedGraphnode - a node to add to the graph.DirectedGraph.getHeads(),
DirectedGraph.getTails()public void removeNode(java.lang.Object node)
MutableEdgeLabelledDirectedGraphremoveNode in interface MutableEdgeLabelledDirectedGraphnode - the node to be removed.public void printGraph()
Copyright © 2012-2019 RoboVM AB. All Rights Reserved.