changes.
[IRC.git] / Robust / src / Analysis / SSJava / MethodSummary.java
1 package Analysis.SSJava;
2
3 import java.util.HashMap;
4 import java.util.Map;
5
6 import IR.Descriptor;
7 import IR.MethodDescriptor;
8
9 public class MethodSummary extends LocationSummary {
10
11   MethodDescriptor md;
12
13   String thisLocName;
14   String globalLocName;
15
16   CompositeLocation pcLoc;
17   CompositeLocation returnLoc;
18
19   Map<Integer, CompositeLocation> mapParamIdxToInferLoc;
20   Map<Descriptor, CompositeLocation> mapVarDescToInferCompositeLocation;
21
22   public MethodSummary(MethodDescriptor md) {
23     this.md = 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";
28   }
29
30   public Map<Descriptor, CompositeLocation> getMapVarDescToInferCompositeLocation() {
31     return mapVarDescToInferCompositeLocation;
32   }
33
34   public void addMapVarNameToInferCompLoc(Descriptor varDesc, CompositeLocation inferLoc) {
35     mapVarDescToInferCompositeLocation.put(varDesc, inferLoc);
36   }
37
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);
43     // } else {
44     // String locName = getLocationName(varName);
45     // return new CompositeLocation(new Location(md, locName));
46     // }
47   }
48
49   public void addMapParamIdxToInferLoc(int paramIdx, CompositeLocation inferLoc) {
50     mapParamIdxToInferLoc.put(paramIdx, inferLoc);
51   }
52
53   public Map<Integer, CompositeLocation> getMapParamIdxToInferLoc() {
54     return mapParamIdxToInferLoc;
55   }
56
57   public void setPCLoc(CompositeLocation pcLoc) {
58     this.pcLoc = pcLoc;
59   }
60
61   public CompositeLocation getPCLoc() {
62     return pcLoc;
63   }
64
65   public void setRETURNLoc(CompositeLocation returnLoc) {
66     this.returnLoc = returnLoc;
67   }
68
69   public CompositeLocation getRETURNLoc() {
70     return returnLoc;
71   }
72
73 }