|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object soot.toolkits.graph.HashMutableDirectedGraph
public class HashMutableDirectedGraph
HashMap based implementation of a MutableBlockGraph.
Field Summary | |
---|---|
protected Chain |
heads
|
protected HashMap<Object,LinkedHashSet<Object>> |
nodeToPreds
|
protected HashMap<Object,LinkedHashSet<Object>> |
nodeToSuccs
|
protected Chain |
tails
|
Constructor Summary | |
---|---|
HashMutableDirectedGraph()
|
Method Summary | |
---|---|
void |
addEdge(Object from,
Object to)
Adds an edge to the graph between 2 nodes. |
void |
addNode(Object node)
Adds a node to the graph. |
void |
clearAll()
Removes all nodes and edges. |
Object |
clone()
|
boolean |
containsEdge(Object from,
Object to)
|
boolean |
containsNode(Object node)
|
List |
getHeads()
Returns a list of entry points for this graph. |
List<Object> |
getNodes()
|
List |
getPredsOf(Object s)
Returns a list of predecessors for the given node in the graph. |
Set |
getPredsOfAsSet(Object s)
Same as getPredsOf(Object) but returns a set. |
List |
getSuccsOf(Object s)
Returns a list of successors for the given node in the graph. |
Set |
getSuccsOfAsSet(Object s)
Same as getSuccsOf(Object) but returns a set. |
List |
getTails()
Returns a list of exit points for this graph. |
Iterator |
iterator()
Returns an iterator for the nodes in this graph. |
void |
printGraph()
|
void |
removeEdge(Object from,
Object to)
Removes an edge between 2 nodes in the graph. |
void |
removeNode(Object node)
Removes a node from the graph. |
int |
size()
Returns the node count for this graph. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected HashMap<Object,LinkedHashSet<Object>> nodeToPreds
protected HashMap<Object,LinkedHashSet<Object>> nodeToSuccs
protected Chain heads
protected Chain tails
Constructor Detail |
---|
public HashMutableDirectedGraph()
Method Detail |
---|
public void clearAll()
public Object clone()
clone
in class Object
public List getHeads()
DirectedGraph
getHeads
in interface DirectedGraph
public List getTails()
DirectedGraph
getTails
in interface DirectedGraph
public List getPredsOf(Object s)
DirectedGraph
getPredsOf
in interface DirectedGraph
public Set getPredsOfAsSet(Object s)
getPredsOf(Object)
but returns a set.
This is faster than calling getPredsOf(Object)
.
Also, certain operations like Collection.contains(Object)
execute faster on the set than on the list.
The returned set is unmodifiable.
public List getSuccsOf(Object s)
DirectedGraph
getSuccsOf
in interface DirectedGraph
public Set getSuccsOfAsSet(Object s)
getSuccsOf(Object)
but returns a set.
This is faster than calling getSuccsOf(Object)
.
Also, certain operations like Collection.contains(Object)
execute faster on the set than on the list.
The returned set is unmodifiable.
public int size()
DirectedGraph
size
in interface DirectedGraph
public Iterator iterator()
DirectedGraph
iterator
in interface Iterable
iterator
in interface DirectedGraph
public void addEdge(Object from, Object to)
MutableDirectedGraph
addEdge
in interface MutableDirectedGraph
from
- out node for the edge.to
- in node for the edge.public void removeEdge(Object from, Object to)
MutableDirectedGraph
removeEdge
in interface MutableDirectedGraph
from
- out node for the edge to remove.to
- in node for the edge to remove.public boolean containsEdge(Object from, Object to)
containsEdge
in interface MutableDirectedGraph
public boolean containsNode(Object node)
containsNode
in interface MutableDirectedGraph
node
- node that we want to know if the graph constains.
public List<Object> getNodes()
getNodes
in interface MutableDirectedGraph
public void addNode(Object node)
MutableDirectedGraph
addNode
in interface MutableDirectedGraph
node
- a node to add to the graph.DirectedGraph.getHeads()
,
DirectedGraph.getTails()
public void removeNode(Object node)
MutableDirectedGraph
removeNode
in interface MutableDirectedGraph
node
- the node to be removed.public void printGraph()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |