This commit was manufactured by cvs2svn to create tag 'buildscript'.
[IRC.git] /
1 package Analysis.Locality;
2 import IR.Flat.*;
3
4
5 public class TempNodePair {
6   TempDescriptor tmp;
7   FlatNode fn;
8
9   public TempNodePair(TempDescriptor tmp) {
10     this.tmp=tmp;
11   }
12
13   public TempDescriptor getTemp() {
14     return tmp;
15   }
16
17   public void setNode(FlatNode fn) {
18     this.fn=fn;
19   }
20
21   public FlatNode getNode() {
22     return fn;
23   }
24
25   public boolean equals(Object o) {
26     if (o instanceof TempNodePair) {
27       TempNodePair tnp=(TempNodePair)o;
28       if (tnp.fn!=null||fn!=null) {
29         // need to check flat node equivalence also
30         if (tnp.fn==null||fn==null||(!fn.equals(tnp.fn)))
31           return false;
32       }
33       return tmp.equals(tnp.tmp);
34     }
35     return false;
36   }
37
38   public int hashCode() {
39     return tmp.hashCode();
40   }
41
42   public String toString() {
43     if (getNode()==null)
44       return "<null,"+getTemp()+">";
45     else
46       return "<"+getNode()+","+getTemp()+">";
47   }
48 }