0fd6c15e94a951fe0207ce672572144fadfdf149
[IRC.git] / Robust / src / ClassLibrary / MGC / Object.java
1 public class Object {
2   public int cachedCode;   //first field has to be a primitive
3   public boolean cachedHash;
4
5   public native int nativehashCode();
6   private Object nextlockobject;
7   private Object prevlockobject;
8
9   // temporary extra unused int filed to align objects for Java
10   //int wkhqwemnbmwnb;
11
12   public int hashCode() {
13     if (!cachedHash) {
14       cachedCode=nativehashCode();
15       cachedHash=true;
16     }
17     return cachedCode;
18   }
19
20   /* DON'T USE THIS METHOD UNLESS NECESSARY */
21   /* WE WILL DEPRECATE IT AS SOON AS INSTANCEOF WORKS */
22   public native int getType();
23
24   public native int MonitorEnter();
25   public native int MonitorExit();
26
27   public String toString() {
28     return "Object"+hashCode();
29   }
30
31   public boolean equals(Object o) {
32     if (o==this)
33       return true;
34     return false;
35   }
36   
37   //public final native Class getClass();
38 }