From 4857b9ef54f05bf77c7724c1f95e7afa548f0108 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Mon, 2 Feb 2009 09:29:07 +0000 Subject: [PATCH] new object --- Robust/src/ClassLibrary/ObjectFC.java | 31 +++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Robust/src/ClassLibrary/ObjectFC.java diff --git a/Robust/src/ClassLibrary/ObjectFC.java b/Robust/src/ClassLibrary/ObjectFC.java new file mode 100644 index 00000000..ae2c437a --- /dev/null +++ b/Robust/src/ClassLibrary/ObjectFC.java @@ -0,0 +1,31 @@ +public class Object { + public int cachedCode; //first field has to be a primitive + public boolean cachedHash; + public Object nextobject; /* Oid */ + public Object localcopy; + private Object tags; + + public native int nativehashCode(); + + public int hashCode() { + if (!cachedHash) { + cachedCode=nativehashCode(); + cachedHash=true; + } + return cachedCode; + } + + /* DON'T USE THIS METHOD UNLESS NECESSARY */ + /* WE WILL DEPRECATE IT AS SOON AS INSTANCEOF WORKS */ + public native int getType(); + + public String toString() { + return "Object"+hashCode(); + } + + public boolean equals(Object o) { + if (o==this) + return true; + return false; + } +} -- 2.34.1