4 package org.vamsas.client;
6 * Base class for all Vamsas objects extracted
7 * from an IClientDocument.
8 * An object maybe registered or unregistered.
13 public abstract class object {
16 * unique id for all vamsas objects
17 * allows unambiguous referencing
18 * to any object in the vamsas document
20 protected boolean __stored_in_document=false;
21 protected long __last_hash=0;
23 protected VorbaId vorbaId=null;
24 protected IVorbaIdFactory __vorba=null;
27 * for the object with all housekeeping
28 * fields at standard values.
30 synchronized protected void doHash() {
32 VorbaId thisid = vorbaId;
33 IVorbaIdFactory factory = __vorba;
34 boolean stored = __stored_in_document;
37 __last_hash = this.hashCode();
40 __stored_in_document = stored;
45 * @return true if object is registered
47 public boolean isRegistered() {
48 return (vorbaId!=null);
51 * Method to get fixed reference for
52 * the object in the vamsas document.
53 * @returns null if object is neither registered
54 * or not associated with a properly instantiated
57 public VorbaId getVorbaId() {
59 // Try to use the associated factory.
61 if ((vorbaId = __vorba.makeVorbaId())==null)
62 return null; // Factory not valid.
69 * used by the IClient implementation
70 * to generate unique Id based on
71 * client applications current namespace.
73 protected void setVorbaId(VorbaId newid) {
78 * @return true if object is present in Vamsas Document.
80 public boolean is__stored_in_document() {
81 return __stored_in_document;
84 * for use by Vorba agent to reflect state of
85 * vamsas object to client application.
86 * @param __stored_in_document The __stored_in_document to set.
88 protected void set__stored_in_document(boolean __stored_in_document) {
89 this.__stored_in_document = __stored_in_document;
92 * __last_hash is the hash value computed
93 * when the object was last checked against
94 * a IClientDocument generated by the
95 * object's parent IClient instance.
96 * @return Returns the __last_hash.
98 public long get__last_hash() {