|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--harpoon.Util.Graphs.SCComponent
SCComponent
models a Strongly connected component \
of a graph.
The only way to split a graph into SCComponent
s is though
buildSSC
.
That method is quite flexible: all it needs is a root node (or a set of
root nodes) and a Navigator: an object implementing the
SCCoomponent.Navigator
interface that provides the
edges coming into/going out of a given Object
. So, it can
build strongly connected components even for graphs that are not built
up from CFGraphable
nodes, a good example being the set of
methods where the edges represent the caller-callee relation (in this
case, the strongly connected components group together sets of mutually
recursive methods).
Nested Class Summary | |
static interface |
SCComponent.Navigator
Indentical to harpoon.Util.Graphs.Navigator . |
Method Summary | |
static Set |
buildSCC(Object[] roots,
SCComponent.Navigator navigator)
Constructs the strongly connected components of the graph containing all the nodes reachable on paths that originate in nodes from roots . |
static SCComponent |
buildSCC(Object root,
SCComponent.Navigator navigator)
Convenient version for the single root case (see the other buildSCC for details). |
int |
compareTo(Object o)
|
boolean |
contains(Object node)
Checks whether node belongs to this \
strongly connected component. |
int |
getId()
Returns the numeric ID of this SCComponent . |
boolean |
isLoop()
Checks whether this strongly connected component
corresponds to a loop, ie it has at least one arc to
itself. |
SCComponent |
next(int i)
Returns the i th successor. |
int |
nextLength()
Returns the number of successors. |
SCComponent |
nextTopSort()
Returns the next SCComponent according to the decreasing
topological order |
Object[] |
nodes()
Returns the nodes of this strongly connected component;
array version - good for iterating over the elements of the SCC. |
Set |
nodeSet()
Returns the nodes of this strongly connected component
(set version). |
SCComponent |
prev(int i)
Returns the i th predecessor. |
int |
prevLength()
Returns the number of predecessors. |
SCComponent |
prevTopSort()
Returns the previous SCComponent according to the
decreasing topological order |
int |
size()
Returns the number of nodes in this strongly connected
component. |
String |
toString()
Pretty print debug function. |
String |
toString(MetaCallGraph mcg)
Pretty print debug function for SCC's of MetaMethod s. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
public static final SCComponent buildSCC(Object root, SCComponent.Navigator navigator)
buildSCC
for details). Returns the single element of
the set of top level SCCs.
public static final Set buildSCC(Object[] roots, SCComponent.Navigator navigator)
roots
. The edges are indicated by navigator
.
Returns the set of the root SCComponent
s, the components
that are not pointed by any other component. This constraint is
actively used in the topological sorting agorithm (see
SCCTopSortedGraph
).
public int getId()
this
SCComponent
.
Just for debug purposes ...
public final boolean isLoop()
this
strongly connected component
corresponds to a loop, ie it has at least one arc to
itself.
public int compareTo(Object o)
compareTo
in interface Comparable
public final int nextLength()
public final SCComponent next(int i)
i
th successor.
public final int prevLength()
public final SCComponent prev(int i)
i
th predecessor.
public final Set nodeSet()
this
strongly connected component
(set version).
public final Object[] nodes()
this
strongly connected component;
array version - good for iterating over the elements of the SCC.
public final int size()
this
strongly connected
component.
public final boolean contains(Object node)
node
belongs to this
\
strongly connected component.
public final SCComponent nextTopSort()
SCComponent
according to the decreasing
topological order
public final SCComponent prevTopSort()
SCComponent
according to the
decreasing topological order
public final String toString()
toString
in class Object
public final String toString(MetaCallGraph mcg)
MetaMethod
s.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |