1 package Analysis.Locality;
2 import IR.MethodDescriptor;
4 public class LocalityBinding {
5 private MethodDescriptor md;
6 private Integer[] isglobal;
7 private boolean istransaction;
8 private Integer isglobalreturn;
9 private Integer isglobalthis;
11 public LocalityBinding(MethodDescriptor md, boolean transaction) {
13 isglobal=new boolean[md.numParameters()];
14 istransaction=transaction;
17 public String toString() {
18 String st=md.toString()+" ";
19 for(int i=0;i<isglobal.length;i++)
27 public void setGlobal(int i, Integer global) {
31 public Integer isGlobal(int i) {
35 public void setGlobalReturn(Integer global) {
36 isglobalreturn=global;
39 public Integer getGlobalReturn() {
40 return isglobalreturn;
43 public void setGlobalThis(Integer global) {
47 public Integer getGlobalThis() {
51 public MethodDescriptor getMethod() {
55 public boolean isTransaction() {
59 public boolean equals(Object o) {
60 if (o instanceof LocalityBinding) {
61 LocalityBinding lb=(LocalityBinding)o;
64 for(int i=0;i<isglobal.length;i++)
65 if (!isglobal[i].equals(lb.isglobal[i]))
67 if (!isglobalthis.equals(lb.isglobalthis))
69 return !istransaction.equals(lb.istransaction);
74 public int hashCode() {
75 int hashcode=md.hashCode();
76 for(int i=0;i<isglobal.length;i++) {
77 hashcode=hashcode*31+(isglobal[i]?0:1);
79 hashcode=hashcode*31+(istransaction?0:1);