changes.
[IRC.git] / Robust / src / Analysis / SSJava / MethodLocationInfo.java
1 package Analysis.SSJava;
2
3 import java.util.HashMap;
4 import java.util.HashSet;
5 import java.util.Map;
6 import java.util.Set;
7
8 import IR.Descriptor;
9 import IR.MethodDescriptor;
10
11 public class MethodLocationInfo extends LocationInfo {
12
13   String returnLocName;
14   String thisLocName;
15   CompositeLocation pcLoc;
16   CompositeLocation returnLoc;
17
18   public CompositeLocation getReturnLoc() {
19     return returnLoc;
20   }
21
22   public void setReturnLoc(CompositeLocation returnLoc) {
23     this.returnLoc = returnLoc;
24   }
25
26   String globalLocName;
27
28   Map<Integer, CompositeLocation> mapParamIdxToInferLoc;
29   Set<String> paramLocNameSet;
30
31   public MethodLocationInfo(MethodDescriptor md) {
32     this.md = md;
33     this.paramLocNameSet = new HashSet<String>();
34     this.pcLoc = new CompositeLocation(new Location(md, Location.TOP));
35     this.mapParamIdxToInferLoc = new HashMap<Integer, CompositeLocation>();
36   }
37
38   public void addMapParamIdxToInferLoc(int paramIdx, CompositeLocation inferLoc) {
39     mapParamIdxToInferLoc.put(paramIdx, inferLoc);
40   }
41
42   public int getNumParam() {
43     return mapParamIdxToInferLoc.keySet().size();
44   }
45
46   public CompositeLocation getParamCompositeLocation(int idx) {
47     return mapParamIdxToInferLoc.get(idx);
48   }
49
50   public Map<Integer, CompositeLocation> getMapParamIdxToInferLoc() {
51     return mapParamIdxToInferLoc;
52   }
53
54   public String getGlobalLocName() {
55     return globalLocName;
56   }
57
58   public void setGlobalLocName(String globalLocName) {
59     this.globalLocName = globalLocName;
60   }
61
62   public String getReturnLocName() {
63     return returnLocName;
64   }
65
66   public void setReturnLocName(String returnLocName) {
67     this.returnLocName = returnLocName;
68   }
69
70   public String getThisLocName() {
71     return thisLocName;
72   }
73
74   public void setThisLocName(String thisLocName) {
75     this.thisLocName = thisLocName;
76   }
77
78   public CompositeLocation getPCLoc() {
79     return pcLoc;
80   }
81
82   public void setPCLoc(CompositeLocation pcLoc) {
83     this.pcLoc = pcLoc;
84   }
85
86   public void removeMaplocalVarToLocSet(Descriptor localVarDesc) {
87     String localVarLocSymbol = localVarDesc.getSymbol();
88     getDescSet(localVarLocSymbol).remove(localVarDesc);
89   }
90
91   public MethodDescriptor getMethodDesc() {
92     return md;
93   }
94
95 }