edu.ksu.cis.indus.dom
Class SlicerDOM

java.lang.Object
  extended by edu.ksu.cis.indus.dom.SlicerDOM

public final class SlicerDOM
extends java.lang.Object

This class encapsulates the logic to extract dependencies from a dependence analysis based on slice direction.

Version:
$Revision$ $Date$
Author:
Venkatesh Prasad Ranganath, $Author$

Constructor Summary
SlicerDOM()
          Creates an instance of this class.
 
Method Summary
 boolean createMarkerForSootStmtMethod(edu.ksu.cis.indus.common.datastructures.Pair stmtMethod, java.lang.String message, long timeStamp)
          Creates a marker for the given statement-method pair with the given message and timestamp.
 void displayDialog(java.lang.String message)
          Displays a dialog with the given message.
 edu.ksu.cis.indus.common.soot.BasicBlockGraphMgr getBasicBlockGraphManager()
          Retrieves a handle to the basic block manager.
 edu.ksu.cis.indus.interfaces.ICallGraphInfo getCallGraph()
          Retrieves a handle to the call graph.
 org.eclipse.jdt.core.ICompilationUnit getCompilationUnit(org.eclipse.core.resources.IFile file)
          Retrieves the compilation unit corresponding to the contents of the given file.
 int getCounter()
          Retrieve the current counter value.
 java.util.Collection<edu.ksu.cis.indus.staticanalyses.dependency.IDependencyAnalysis> getDA(java.lang.Comparable<?> id)
          Retrieves a handle to the requested dependence analysis info.
 java.util.Collection<edu.ksu.cis.indus.staticanalyses.dependency.IDependencyAnalysis> getDAs()
          Retrieves a handle to all dependence analyses.
 edu.ksu.cis.indus.interfaces.IEnvironment getEnvironment()
          Retrieves a handle to the environment.
 edu.ksu.cis.indus.interfaces.IEscapeInfo getEscapeInfo()
          Retrieves a handle to the escape info.
 java.util.ArrayList getFileFor(soot.SootClass sc)
          Retrieves the files corresponding to the class represented by the given class.
 soot.SootMethod getJimpleMethodForSelection()
          Retrieves the Jimple method corresponding to the method that contains the current selection.
 java.util.Collection<soot.jimple.Stmt> getJimpleStmtsFor(org.eclipse.core.resources.IFile thefile, org.eclipse.jdt.core.IType theclass, org.eclipse.jdt.core.IMethod themethod, int theline)
          Retrieves the Jimple statements for the given line in the given method in the given type in the given file.
 java.util.Collection<soot.jimple.Stmt> getJimpleStmtsForSelection()
          Retrieves the Jimple statements for the given selection.
 edu.ksu.cis.indus.kaveri.KaveriPlugin getKaveriPlugin()
          Retrieves a handle to the Kaveri plugin.
 org.eclipse.jdt.core.IMethod getMethodForIn(soot.SootMethod sm, org.eclipse.core.resources.IFile file)
          Retrieves the JDT method corresponding the given Soot method.
 edu.ksu.cis.indus.interfaces.IMonitorInfo getMonitorInfo()
          Retrieves a handle to the monitor information.
 edu.ksu.cis.indus.staticanalyses.interfaces.IValueAnalyzer<soot.Value> getOFAnalyzer()
          Retrieves a handle to the object-flow analyzer.
 edu.ksu.cis.indus.interfaces.IReadWriteInfo getReadWriteInfo()
          Retrieves a handle to the read-write info.
 java.util.Collection<soot.SootMethod> getRootMethods()
          Retrieves the collection root/entry methods.
 org.eclipse.jface.viewers.ISelection getSelection()
          Retrieves the current selection (if any) in the active editor (if any).
 org.eclipse.jdt.core.ICompilationUnit getSelectionContainingCompilationUnit()
          Retrieves the compilation unit corresponding to the file in which the current selection occurs.
 org.eclipse.core.resources.IFile getSelectionContainingFile()
          Retrieves the file containing the selection.
 edu.ksu.cis.indus.tools.slicer.SlicerTool getSlicerTool()
          Retrieves a handle to the slicer tool.
 edu.ksu.cis.indus.common.soot.IStmtGraphFactory<?> getStmtGraphFactory()
          Retrieves a handle to the CFG factory.
 org.eclipse.ui.IWorkbench getWorkbench()
          Get a handle to the workbench.
 org.eclipse.core.resources.IWorkspace getWorkSpace()
          Get a handle to the workspace.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SlicerDOM

SlicerDOM()
Creates an instance of this class.

Method Detail

getCounter

public int getCounter()
Retrieve the current counter value.


getWorkbench

public org.eclipse.ui.IWorkbench getWorkbench()
Get a handle to the workbench.

Returns:
the workbench.

getWorkSpace

public org.eclipse.core.resources.IWorkspace getWorkSpace()
Get a handle to the workspace.

Returns:
the workspace.

getFileFor

public java.util.ArrayList getFileFor(soot.SootClass sc)
                               throws org.eclipse.core.runtime.CoreException
Retrieves the files corresponding to the class represented by the given class.

Returns:
the Java files containing the definition of the class.
Throws:
org.eclipse.core.runtime.CoreException

createMarkerForSootStmtMethod

public boolean createMarkerForSootStmtMethod(edu.ksu.cis.indus.common.datastructures.Pair stmtMethod,
                                             java.lang.String message,
                                             long timeStamp)
                                      throws org.eclipse.core.runtime.CoreException
Creates a marker for the given statement-method pair with the given message and timestamp.

Parameters:
stmtMethod - is a pair of statement and method that is to be bookmarked.
message - is the message of the bookmark.
timeStamp - to be included in the message.
Returns:
true if a marker was added; false, otherwise.
Throws:
org.eclipse.core.runtime.CoreException

getMethodForIn

public org.eclipse.jdt.core.IMethod getMethodForIn(soot.SootMethod sm,
                                                   org.eclipse.core.resources.IFile file)
                                            throws org.eclipse.jdt.core.JavaModelException
Retrieves the JDT method corresponding the given Soot method.

Parameters:
sm - is the Soot method.
file - in which the corresponding JDT method is to be searched for.
Returns:
the JDT method.
Throws:
org.eclipse.jdt.core.JavaModelException

displayDialog

public void displayDialog(java.lang.String message)
Displays a dialog with the given message.

Parameters:
message - to be displayed.

getSelection

public org.eclipse.jface.viewers.ISelection getSelection()
Retrieves the current selection (if any) in the active editor (if any).

Returns:
the selection, if one exists; null, otherwise.

getSelectionContainingFile

public org.eclipse.core.resources.IFile getSelectionContainingFile()
Retrieves the file containing the selection.

Returns:
the file.

getCompilationUnit

public org.eclipse.jdt.core.ICompilationUnit getCompilationUnit(org.eclipse.core.resources.IFile file)
Retrieves the compilation unit corresponding to the contents of the given file.

Returns:
the compilation unit.

getSelectionContainingCompilationUnit

public org.eclipse.jdt.core.ICompilationUnit getSelectionContainingCompilationUnit()
Retrieves the compilation unit corresponding to the file in which the current selection occurs.

Returns:
the compilation unit.

getJimpleMethodForSelection

public soot.SootMethod getJimpleMethodForSelection()
                                            throws org.eclipse.jdt.core.JavaModelException
Retrieves the Jimple method corresponding to the method that contains the current selection.

Returns:
the Jimple method.
Throws:
org.eclipse.jdt.core.JavaModelException

getJimpleStmtsForSelection

public java.util.Collection<soot.jimple.Stmt> getJimpleStmtsForSelection()
                                                                  throws org.eclipse.jdt.core.JavaModelException
Retrieves the Jimple statements for the given selection.

Returns:
the corresponding Jimple statements.
Throws:
org.eclipse.jdt.core.JavaModelException

getJimpleStmtsFor

public java.util.Collection<soot.jimple.Stmt> getJimpleStmtsFor(org.eclipse.core.resources.IFile thefile,
                                                                org.eclipse.jdt.core.IType theclass,
                                                                org.eclipse.jdt.core.IMethod themethod,
                                                                int theline)
Retrieves the Jimple statements for the given line in the given method in the given type in the given file.

Parameters:
thefile - containing theclass.
theclass - containing themethod.
themethod - containing theline.
theline - of interest.
Returns:
the corresponding Jimple statements.

getKaveriPlugin

public edu.ksu.cis.indus.kaveri.KaveriPlugin getKaveriPlugin()
Retrieves a handle to the Kaveri plugin.

Returns:
a handle to the plugin.

getEscapeInfo

public edu.ksu.cis.indus.interfaces.IEscapeInfo getEscapeInfo()
Retrieves a handle to the escape info.

Returns:
a handle to the escape info.

getReadWriteInfo

public edu.ksu.cis.indus.interfaces.IReadWriteInfo getReadWriteInfo()
Retrieves a handle to the read-write info.

Returns:
a handle to the read-write info.

getEnvironment

public edu.ksu.cis.indus.interfaces.IEnvironment getEnvironment()
Retrieves a handle to the environment.

Returns:
a handle to the environment.

getSlicerTool

public edu.ksu.cis.indus.tools.slicer.SlicerTool getSlicerTool()
Retrieves a handle to the slicer tool.

Returns:
a handle to the slicer tool.

getBasicBlockGraphManager

public edu.ksu.cis.indus.common.soot.BasicBlockGraphMgr getBasicBlockGraphManager()
Retrieves a handle to the basic block manager.

Returns:
a handle to the basic block manager.

getOFAnalyzer

public edu.ksu.cis.indus.staticanalyses.interfaces.IValueAnalyzer<soot.Value> getOFAnalyzer()
Retrieves a handle to the object-flow analyzer.

Returns:
a handle to the object-flow analyzer.

getCallGraph

public edu.ksu.cis.indus.interfaces.ICallGraphInfo getCallGraph()
Retrieves a handle to the call graph.

Returns:
a handle to the call graph.

getMonitorInfo

public edu.ksu.cis.indus.interfaces.IMonitorInfo getMonitorInfo()
Retrieves a handle to the monitor information.

Returns:
a handle to the monitor information.

getRootMethods

public java.util.Collection<soot.SootMethod> getRootMethods()
Retrieves the collection root/entry methods.

Returns:
the collection of root/entry methods.

getDA

public java.util.Collection<edu.ksu.cis.indus.staticanalyses.dependency.IDependencyAnalysis> getDA(java.lang.Comparable<?> id)
Retrieves a handle to the requested dependence analysis info.

Returns:
a handle to the requested dependence analysis info.

getDAs

public java.util.Collection<edu.ksu.cis.indus.staticanalyses.dependency.IDependencyAnalysis> getDAs()
Retrieves a handle to all dependence analyses.

Returns:
a handle to all dependence analyses.

getStmtGraphFactory

public edu.ksu.cis.indus.common.soot.IStmtGraphFactory<?> getStmtGraphFactory()
Retrieves a handle to the CFG factory.

Returns:
a handle to the CFG factory.