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