From: jprocter Date: Wed, 6 Sep 2006 13:43:37 +0000 (+0000) Subject: added V_parent reference to parent object in document. X-Git-Tag: Release_0.2~284 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=68900831aeb1b3981c579a406bfe5df057d556e0;p=vamsas.git added V_parent reference to parent object in document. git-svn-id: https://svn.lifesci.dundee.ac.uk/svn/repository/trunk@236 be28352e-c001-0410-b1a7-c7978e42abec --- diff --git a/src/org/vamsas/client/Vobject.java b/src/org/vamsas/client/Vobject.java index a393b9e..e27ee86 100644 --- a/src/org/vamsas/client/Vobject.java +++ b/src/org/vamsas/client/Vobject.java @@ -39,7 +39,10 @@ public abstract class Vobject { */ protected boolean registerable = false; - + /** + * reference to containing object for this Vobject. + */ + protected Vobject V_parent=null; /** * unique id for all vamsas objects allows unambiguous referencing to any * Vobject in the vamsas document @@ -50,6 +53,16 @@ public abstract class Vobject { * the source of unique VorbaIds. */ protected IVorbaIdFactory __vorba = null; + + /* (non-Javadoc) + * @see java.lang.Object#finalize() + */ + protected void finalize() throws Throwable { + V_parent=null; + __vorba=null; + vorbaId=null; + super.finalize(); + } /** * @@ -119,6 +132,8 @@ public abstract class Vobject { synchronized protected boolean doHash() { long __old_hash = __last_hash; __last_hash = 0; + Vobject _V_parent=V_parent; + V_parent=null; VorbaId thisid = vorbaId; IVorbaIdFactory factory = __vorba; boolean stored = __stored_in_document; @@ -128,6 +143,7 @@ public abstract class Vobject { vorbaId = thisid; __vorba = factory; __stored_in_document = stored; + V_parent=_V_parent; return (__old_hash==0) || (__old_hash == __last_hash); } @@ -270,6 +286,8 @@ public abstract class Vobject { for (int k=0, l=vals.length; k