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