1 package Analysis.Disjoint;
3 import IR.FieldDescriptor;
4 import IR.Flat.TempDescriptor;
9 public static final int read = 1;
10 public static final int write = 2;
11 public static final int strongupdate = 3;
13 // identify an allocation site of affected object
14 protected AllocSite affectedAllocSite;
16 // identify operation type
20 protected FieldDescriptor field;
22 public Effect(AllocSite affectedAS, int type, FieldDescriptor field) {
23 this.affectedAllocSite = affectedAS;
28 public AllocSite getAffectedAllocSite() {
29 return affectedAllocSite;
32 public void setAffectedAllocSite(AllocSite affectedAllocSite) {
33 this.affectedAllocSite = affectedAllocSite;
36 public int getType() {
40 public void setType(int type) {
44 public FieldDescriptor getField() {
48 public void setField(FieldDescriptor field) {
52 public boolean equals(Object o) {
58 if (!(o instanceof Effect)) {
62 Effect in = (Effect) o;
64 if (affectedAllocSite.equals(in.getAffectedAllocSite())
65 && type == in.getType()
66 && field.equals(in.getField())) {
73 public int hashCode() {
75 int hash = affectedAllocSite.hashCode();
80 hash = hash ^ field.hashCode();
87 public String toString() {
90 s += affectedAllocSite.toStringBrief();
94 } else if (type == write) {
100 s += ", " + field.toStringBrief();