more 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   String globalLocName;
17
18   Map<Integer, CompositeLocation> mapParamIdxToInferLoc;
19   Set<String> paramLocNameSet;
20
21   public MethodLocationInfo(MethodDescriptor md) {
22     this.md = md;
23     this.paramLocNameSet = new HashSet<String>();
24     this.pcLoc = new CompositeLocation(new Location(md, Location.TOP));
25     this.mapParamIdxToInferLoc = new HashMap<Integer, CompositeLocation>();
26   }
27
28   public void addMapParamIdxToInferLoc(int paramIdx, CompositeLocation inferLoc) {
29     mapParamIdxToInferLoc.put(paramIdx, inferLoc);
30   }
31
32   public int getNumParam() {
33     return mapParamIdxToInferLoc.keySet().size();
34   }
35
36   public CompositeLocation getParamCompositeLocation(int idx) {
37     return mapParamIdxToInferLoc.get(idx);
38   }
39
40   public Map<Integer, CompositeLocation> getMapParamIdxToInferLoc() {
41     return mapParamIdxToInferLoc;
42   }
43
44   public String getGlobalLocName() {
45     return globalLocName;
46   }
47
48   public void setGlobalLocName(String globalLocName) {
49     this.globalLocName = globalLocName;
50   }
51
52   public String getReturnLocName() {
53     return returnLocName;
54   }
55
56   public void setReturnLocName(String returnLocName) {
57     this.returnLocName = returnLocName;
58   }
59
60   public String getThisLocName() {
61     return thisLocName;
62   }
63
64   public void setThisLocName(String thisLocName) {
65     this.thisLocName = thisLocName;
66   }
67
68   public CompositeLocation getPCLoc() {
69     return pcLoc;
70   }
71
72   public void setPCLoc(CompositeLocation pcLoc) {
73     this.pcLoc = pcLoc;
74   }
75
76   public void removeMaplocalVarToLocSet(Descriptor localVarDesc) {
77     String localVarLocSymbol = localVarDesc.getSymbol();
78     getDescSet(localVarLocSymbol).remove(localVarDesc);
79   }
80
81 }