More code to implement tags
[IRC.git] / Robust / src / IR / Flat / TempTagPair.java
1 package IR.Flat;
2 import IR.TagDescriptor;
3
4 public class TempTagPair {
5     TagDescriptor tagd;
6     TempDescriptor td;
7     TempDescriptor tagt;
8
9     public TempTagPair(TempDescriptor td, TagDescriptor tagd, TempDescriptor tagt) {
10         this.tagd=tagd;
11         this.tagt=tagt;
12         this.td=td;
13     }
14     public int hashCode() {
15         return tagd.hashCode()^td.hashCode()^tagt.hashCode();
16     }
17     
18     public TempDescriptor getTemp() {
19         return td;
20     }
21
22     public TagDescriptor getTag() {
23         return tagd;
24     }
25
26     public TempDescriptor getTagTemp() {
27         return tagt;
28     }
29
30     public boolean equals(Object o) {
31         if (!(o instanceof TempTagPair))
32             return false;
33         TempTagPair ttp=(TempTagPair)o;
34         return ttp.tagd.equals(tagd)&&ttp.tagt==tagt&&ttp.td==td;
35     }
36
37     public String toString() {
38         return "<"+td+","+tagd+","+tagt+">";
39     }
40 }