de.uka.ipd.sdq.ByCounter.parsing
Class CallGraph

java.lang.Object
  extended by de.uka.ipd.sdq.ByCounter.parsing.CallGraph

public final class CallGraph
extends java.lang.Object

The static call graph where the nodes are methods. Two methods m1, m2 are connected if m1 contains instructions to call m2.

Author:
Martin Krogmann

Constructor Summary
CallGraph()
          Creates a CallGraph with only a root node.
 
Method Summary
 void addMethodCall(CallGraphMethod m1, CallGraphMethod m2)
          Adds a link from method m1 to method m2.
 void addParsedClass(java.lang.String parsedClass)
          Add a class to the set of parsed classes.
 CallGraphMethod findMethod(MethodDescriptor method)
          Find the specified method in the graph.
 java.util.HashSet<java.lang.String> getParsedClasses()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CallGraph

public CallGraph()
Creates a CallGraph with only a root node.

Method Detail

addMethodCall

public void addMethodCall(CallGraphMethod m1,
                          CallGraphMethod m2)
Adds a link from method m1 to method m2.

Parameters:
m1 - Caller method.
m2 - Callee method.

addParsedClass

public void addParsedClass(java.lang.String parsedClass)
Add a class to the set of parsed classes.

Parameters:
parsedClass - The canonical name of a class that has been parsed into the call tree.
See Also:
getParsedClasses()

getParsedClasses

public java.util.HashSet<java.lang.String> getParsedClasses()
Returns:
The set of all classes that have been considered in the call graph.
See Also:
addParsedClass(String)

findMethod

public CallGraphMethod findMethod(MethodDescriptor method)
Find the specified method in the graph.

Parameters:
method - A MethodDescriptor for the method to search.
Returns:
The CallGraphMethod node in the graph if method was found. Null otherwise.