Package soot.toolkits.graph
Class HashReversibleGraph<N>
- java.lang.Object
-
- soot.toolkits.graph.HashMutableDirectedGraph<N>
-
- soot.toolkits.graph.HashReversibleGraph<N>
-
- Type Parameters:
N-
- All Implemented Interfaces:
Iterable<N>,DirectedGraph<N>,MutableDirectedGraph<N>,ReversibleGraph<N>
public class HashReversibleGraph<N> extends HashMutableDirectedGraph<N> implements ReversibleGraph<N>
A reversible version of HashMutableDirectedGraph- Author:
- Navindra Umanee
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanreversed-
Fields inherited from class soot.toolkits.graph.HashMutableDirectedGraph
heads, nodeToPreds, nodeToSuccs, tails
-
-
Constructor Summary
Constructors Constructor Description HashReversibleGraph()HashReversibleGraph(DirectedGraph<N> dg)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEdge(N from, N to)Adds an edge to the graph between 2 nodes.booleancontainsEdge(N from, N to)List<N>getHeads()Returns a list of entry points for this graph.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.booleanisReversed()Returns true if the graph is now reversed from its original state at creation.voidremoveEdge(N from, N to)Removes an edge between 2 nodes in the graph.ReversibleGraph<N>reverse()Reverse the edges of the current graph and swap head and tail nodes.-
Methods inherited from class soot.toolkits.graph.HashMutableDirectedGraph
addNode, clearAll, clone, containsNode, getNodes, getPredsOfAsSet, getSuccsOfAsSet, iterator, printGraph, removeNode, size
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface soot.toolkits.graph.DirectedGraph
iterator, size
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface soot.toolkits.graph.MutableDirectedGraph
addNode, containsNode, getNodes, removeNode
-
-
-
-
Constructor Detail
-
HashReversibleGraph
public HashReversibleGraph(DirectedGraph<N> dg)
-
HashReversibleGraph
public HashReversibleGraph()
-
-
Method Detail
-
isReversed
public boolean isReversed()
Description copied from interface:ReversibleGraphReturns true if the graph is now reversed from its original state at creation.- Specified by:
isReversedin interfaceReversibleGraph<N>
-
reverse
public ReversibleGraph<N> reverse()
Description copied from interface:ReversibleGraphReverse the edges of the current graph and swap head and tail nodes. Returns self.- Specified by:
reversein interfaceReversibleGraph<N>
-
addEdge
public void addEdge(N from, N to)
Description copied from interface:MutableDirectedGraphAdds an edge to the graph between 2 nodes. If the edge is already present no change is made.- Specified by:
addEdgein interfaceMutableDirectedGraph<N>- Overrides:
addEdgein classHashMutableDirectedGraph<N>- Parameters:
from- out node for the edge.to- in node for the edge.
-
removeEdge
public void removeEdge(N from, N to)
Description copied from interface:MutableDirectedGraphRemoves an edge between 2 nodes in the graph. If the edge is not present no change is made.- Specified by:
removeEdgein interfaceMutableDirectedGraph<N>- Overrides:
removeEdgein classHashMutableDirectedGraph<N>- Parameters:
from- out node for the edge to remove.to- in node for the edge to remove.
-
containsEdge
public boolean containsEdge(N from, N to)
- Specified by:
containsEdgein interfaceMutableDirectedGraph<N>- Overrides:
containsEdgein classHashMutableDirectedGraph<N>- Returns:
- true if the graph contains an edge the 2 nodes false otherwise.
-
getHeads
public List<N> getHeads()
Description copied from interface:DirectedGraphReturns a list of entry points for this graph.- Specified by:
getHeadsin interfaceDirectedGraph<N>- Overrides:
getHeadsin classHashMutableDirectedGraph<N>
-
getTails
public List<N> getTails()
Description copied from interface:DirectedGraphReturns a list of exit points for this graph.- Specified by:
getTailsin interfaceDirectedGraph<N>- Overrides:
getTailsin classHashMutableDirectedGraph<N>
-
getPredsOf
public List<N> getPredsOf(N s)
Description copied from interface:DirectedGraphReturns a list of predecessors for the given node in the graph.- Specified by:
getPredsOfin interfaceDirectedGraph<N>- Overrides:
getPredsOfin classHashMutableDirectedGraph<N>
-
getSuccsOf
public List<N> getSuccsOf(N s)
Description copied from interface:DirectedGraphReturns a list of successors for the given node in the graph.- Specified by:
getSuccsOfin interfaceDirectedGraph<N>- Overrides:
getSuccsOfin classHashMutableDirectedGraph<N>
-
-