1 package Analysis.SSJava;
3 import java.util.HashMap;
7 import IR.MethodDescriptor;
9 public class MethodSummary extends LocationSummary {
16 CompositeLocation pcLoc;
17 CompositeLocation returnLoc;
19 Map<Integer, CompositeLocation> mapParamIdxToInferLoc;
20 Map<Descriptor, CompositeLocation> mapVarDescToInferCompositeLocation;
22 public MethodSummary(MethodDescriptor md) {
24 this.pcLoc = new CompositeLocation(new Location(md, Location.TOP));
25 this.mapParamIdxToInferLoc = new HashMap<Integer, CompositeLocation>();
26 this.mapVarDescToInferCompositeLocation = new HashMap<Descriptor, CompositeLocation>();
27 this.thisLocName = "this";
30 public Map<Descriptor, CompositeLocation> getMapVarDescToInferCompositeLocation() {
31 return mapVarDescToInferCompositeLocation;
34 public void addMapVarNameToInferCompLoc(Descriptor varDesc, CompositeLocation inferLoc) {
35 mapVarDescToInferCompositeLocation.put(varDesc, inferLoc);
38 public CompositeLocation getInferLocation(Descriptor varDesc) {
39 return mapVarDescToInferCompositeLocation.get(varDesc);
40 // if (mapVarNameToInferCompositeLocation.containsKey(varName)) {
41 // // it already has a composite location assignment.
42 // return mapVarNameToInferCompositeLocation.get(varName);
44 // String locName = getLocationName(varName);
45 // return new CompositeLocation(new Location(md, locName));
49 public void addMapParamIdxToInferLoc(int paramIdx, CompositeLocation inferLoc) {
50 mapParamIdxToInferLoc.put(paramIdx, inferLoc);
53 public Map<Integer, CompositeLocation> getMapParamIdxToInferLoc() {
54 return mapParamIdxToInferLoc;
57 public void setPCLoc(CompositeLocation pcLoc) {
61 public CompositeLocation getPCLoc() {
65 public void setRETURNLoc(CompositeLocation returnLoc) {
66 this.returnLoc = returnLoc;
69 public CompositeLocation getRETURNLoc() {