2 * Created on 12-Sep-2005
4 * TODO To change the template for this generated file go to
5 * Window - Preferences - Java - Code Style - Code Templates
7 package org.vamsas.client;
10 * The unique reference id for a Vamsas document Vobject,
11 * used by applications to refer to the vamsas Vobject
12 * within their own data space in the vamsas document.
13 * TODO: decide if VorbaId should contain a reference
14 * to either the IVorbaIdFactory that made it or the
15 * IClient that defines the session (it might be
19 public class VorbaId {
24 private VorbaId(String Id) {
30 * @param vorbaObject the source of vorba Ids
31 * @param vobject the Vobject to be registered with a new vorba id
34 protected static VorbaId newId(IVorbaIdFactory vorbaObject, Vobject vobject) {
35 // Make unique id from appSpace info in vorbaObject
36 synchronized (vorbaObject) {
37 vobject.vorbaId=vorbaObject.makeVorbaId(vobject);
38 return vobject.vorbaId;
41 protected static VorbaId newId(String id) {
42 return new VorbaId(id);
45 * @return Returns the id.
47 public String getId() {
51 * @see java.lang.Object#equals(java.lang.Object)
53 public boolean equals(Object obj) {
54 if (obj instanceof String)
55 return id.equals(obj);
56 else if (obj instanceof VorbaId)
57 return id.equals(((VorbaId)obj).id);
61 * @see java.lang.Object#hashCode()
63 public int hashCode() {
67 * @see java.lang.Object#toString()
69 public String toString() {