Main Page   Packages   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

SlicePoint.java

00001 package edu.ksu.cis.bandera.pdgslicer.datastructure;
00002 
00003 import ca.mcgill.sable.soot.*;
00004 import ca.mcgill.sable.soot.jimple.*;
00005 import java.util.*;
00006 
00007 public class SlicePoint extends SliceInterest {
00008     protected SootMethod sm;
00009     protected Stmt stmt;
00010     protected int index;
00011 /**
00012  * 
00013  * @param sootClass ca.mcgill.sable.soot.SootClass
00014  * @param sootMethod ca.mcgill.sable.soot.SootMethod
00015  * @param stmt ca.mcgill.sable.soot.jimple.Stmt
00016  */
00017 public SlicePoint(SootClass sootClass, SootMethod sootMethod, Stmt stmt, int in) {
00018     super(sootClass);
00019     this.sm = sootMethod;
00020     this.stmt = stmt;
00021     this.index = in;
00022 }
00023 /**
00024  * 
00025  * @return boolean
00026  * @param object java.lang.Object
00027  */
00028 public boolean equals(Object object) {
00029     if (object instanceof SlicePoint) {
00030         SlicePoint sp = (SlicePoint) object;
00031         return stmt.equals(sp.getStmt()) && sm==sp.getSootMethod() && sc==sp.getSootClass();
00032     } else {
00033         return false;
00034     }
00035 }
00036 /**
00037  * Insert the method's description here.
00038  * Creation date: (00-7-2 22:27:28)
00039  * @return int
00040  */
00041 public int getIndex() {
00042     return index;
00043 }
00044 /**
00045  * 
00046  * @return ca.mcgill.sable.soot.SootMethod
00047  */
00048 public SootMethod getSootMethod() {
00049     return sm;
00050 }
00051 /**
00052  * 
00053  * @return ca.mcgill.sable.soot.jimple.Stmt
00054  */
00055 public Stmt getStmt() {
00056     return stmt;
00057 }
00058 /**
00059  * Insert the method's description here.
00060  * Creation date: (00-7-4 12:32:04)
00061  * @return int
00062  * @param sootMethod ca.mcgill.sable.soot.SootMethod
00063  * @param st ca.mcgill.sable.soot.jimple.Stmt
00064  */
00065 public static int getStmtIndex(SootMethod sootMethod, Stmt st) {
00066     JimpleBody jimpleBody = (JimpleBody) sootMethod.getBody(Jimple.v());
00067     StmtList stmtList = jimpleBody.getStmtList();
00068     int ind = stmtList.indexOf(st);
00069     return ind;
00070 }
00071 /**
00072  * 
00073  * @return int
00074  */
00075 public int hashCode() {
00076     return stmt.hashCode();
00077 }
00078 /**
00079  * Insert the method's description here.
00080  * Creation date: (00-7-2 22:44:34)
00081  * @param in int
00082  */
00083 public void setIndex(int in) {
00084     index = in;
00085 }
00086 /**
00087  * Insert the method's description here.
00088  * Creation date: (00-7-2 22:45:39)
00089  * @param smm ca.mcgill.sable.soot.SootMethod
00090  */
00091 public void setSootMethod(SootMethod smm) {
00092     sm = smm;
00093 }
00094 /**
00095  * Insert the method's description here.
00096  * Creation date: (00-7-2 22:45:04)
00097  * @param s ca.mcgill.sable.soot.jimple.Stmt
00098  */
00099 public void setStmt(Stmt s) {
00100     stmt = s;
00101 }
00102 /**
00103  * 
00104  * @return java.lang.String
00105  */
00106 public String toString() {
00107     return stmt.toString()+" :: " + getSootMethod();
00108 }
00109 }

Generated at Thu Feb 7 06:55:00 2002 for Bandera by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001