soot.toolkits.graph
Class InverseGraph<N>

java.lang.Object
  extended by soot.toolkits.graph.InverseGraph<N>
All Implemented Interfaces:
Iterable<N>, DirectedGraph<N>

public class InverseGraph<N>
extends Object
implements DirectedGraph<N>

An inverted graph of a directed graph.

Author:
Eric Bodden

Field Summary
protected  DirectedGraph<N> g
           
 
Constructor Summary
InverseGraph(DirectedGraph<N> g)
           
 
Method Summary
 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.
 Iterator<N> iterator()
          Returns an iterator for the nodes in this graph.
 int size()
          Returns the node count for this graph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

g

protected final DirectedGraph<N> g
Constructor Detail

InverseGraph

public InverseGraph(DirectedGraph<N> g)
Method Detail

getHeads

public List<N> getHeads()
Returns a list of entry points for this graph.

Specified by:
getHeads in interface DirectedGraph<N>

getPredsOf

public List<N> getPredsOf(N s)
Returns a list of predecessors for the given node in the graph.

Specified by:
getPredsOf in interface DirectedGraph<N>

getSuccsOf

public List<N> getSuccsOf(N s)
Returns a list of successors for the given node in the graph.

Specified by:
getSuccsOf in interface DirectedGraph<N>

getTails

public List<N> getTails()
Returns a list of exit points for this graph.

Specified by:
getTails in interface DirectedGraph<N>

iterator

public Iterator<N> iterator()
Returns an iterator for the nodes in this graph. No specific ordering of the nodes is guaranteed.

Specified by:
iterator in interface Iterable<N>
Specified by:
iterator in interface DirectedGraph<N>

size

public int size()
Returns the node count for this graph.

Specified by:
size in interface DirectedGraph<N>