sofya.apps.dejavu
Class CFGLoader

java.lang.Object
  extended by sofya.apps.dejavu.CFGLoader
All Implemented Interfaces:
GraphLoader

public class CFGLoader
extends java.lang.Object
implements GraphLoader

Loader class for control flow graphs.

Version:
09/20/2004
Author:
CS562 2003 dev team, Alex Kinneer

Constructor Summary
CFGLoader()
          Standard constructor, initializes the loader.
 
Method Summary
 Graph getGraph(java.lang.String method)
          Returns the control flow graph for the specified method.
 java.lang.String[] getMethodList()
          Returns the list of methods for which control flow graphs can be retrieved.
 void setClass(java.lang.String className, java.lang.String tag)
          Sets the current class from which control flow graphs are to be retrieved.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CFGLoader

public CFGLoader()
Standard constructor, initializes the loader.

Method Detail

setClass

public void setClass(java.lang.String className,
                     java.lang.String tag)
              throws java.io.FileNotFoundException,
                     EmptyFileException,
                     BadFileFormatException,
                     java.io.IOException
Sets the current class from which control flow graphs are to be retrieved.

Specified by:
setClass in interface GraphLoader
Parameters:
className - Name of the class from which to load control flow graphs.
tag - Database tag associated with the class file's control flow data.
Throws:
java.io.FileNotFoundException - If no control flow file can be found for the specified class.
EmptyFileException - If the control flow file for the specified class contains no data.
BadFileFormatException - If the control flow file for the specified class is corrupted.
java.io.IOException - For any other type of IO error that prevents the control flow file from being read successfully.

getMethodList

public java.lang.String[] getMethodList()
                                 throws java.lang.IllegalStateException
Returns the list of methods for which control flow graphs can be retrieved. Note: setClass(java.lang.String, java.lang.String) must be called before this method or an exception will be thrown.

Specified by:
getMethodList in interface GraphLoader
Returns:
The list of methods for which control flow graphs are available.
Throws:
java.lang.IllegalStateException - If setClass has not been called prior to calling this method.

getGraph

public Graph getGraph(java.lang.String method)
               throws MethodNotFoundException,
                      java.lang.IllegalStateException
Returns the control flow graph for the specified method. Note: setClass(java.lang.String, java.lang.String) must be called before this method or an exception will be thrown.

Specified by:
getGraph in interface GraphLoader
Parameters:
method - Name of the method for which a control flow graph is to be retrieved.
Returns:
The control flow graph for that method.
Throws:
MethodNotFoundException - If a method by the given name does not exist in the control flow file.
java.lang.IllegalStateException - If setClass has not been called prior to calling this method.