move hashcode into header...part of prep to switch class libraries
[IRC.git] / Robust / src / ClassLibrary / JavaSTM / Object.java
1 public class Object {
2   public native int nativehashCode();
3   private int objstatus;
4   private Object objlocation;
5
6   public int hashCode() {
7     if (!cachedHash) {
8       cachedCode=nativehashCode();
9       cachedHash=true;
10     }
11     return cachedCode;
12   }
13
14   /* DON'T USE THIS METHOD UNLESS NECESSARY */
15   /* WE WILL DEPRECATE IT AS SOON AS INSTANCEOF WORKS */
16   public native int getType();
17
18   public String toString() {
19     return "Object"+hashCode();
20   }
21
22   public boolean equals(Object o) {
23     if (o==this)
24       return true;
25     return false;
26   }
27 }