add more comments
[IRC.git] / Robust / src / ClassLibrary / ObjectJavaNT.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     public Object foo;
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 String.valueOf(this);
22     }
23
24     public boolean equals(Object o) {
25         if (o==this)
26             return true;
27         return false;
28     }
29 }