org.isam.exehda
Class ObjectId

java.lang.Object
  |
  +--org.isam.exehda.HierarchicalId
        |
        +--org.isam.exehda.ObjectId
All Implemented Interfaces:
java.io.Serializable

public final class ObjectId
extends HierarchicalId

Uniquely identifies an EXEHDA Object (formelly an OX) in the system. Unicity is guaranteed by using the ID of the host were the object was first instantiated, what it supposed to be unique in the system, as the parent id and localy generated unique 32 bits long interger generated at that host as local id.

Version:
$Date: 2004/12/16 19:43:26 $ $Revision: 1.7 $
Author:
last modified by $Author: lucc $
See Also:
Serialized Form

Constructor Summary
ObjectId()
          Creates a new ObjectId instance.
 
Method Summary
 boolean equals(java.lang.Object o)
          Implements HierarchicalId equality semantics.
 HostId getHost()
          Returns the base host of this OX (i.e. the host were the OX was first instantiated).
protected  java.lang.Object getLocalId()
          Subclasses must overwrite this method and return an Object representation of the local id.
protected  java.lang.String getType()
          Subclasses must overwrite this method and return a String representation of the ID's type.
 int hashCode()
          Implements the hash code semantics for HierarchicalId objects so that those object would be used as keys in a java.util Hashtable.
 
Methods inherited from class org.isam.exehda.HierarchicalId
getParentId, isRoot, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ObjectId

public ObjectId()
Creates a new ObjectId instance. Assumes HostId.getLocalHost() as the parent ID.

Method Detail

getHost

public HostId getHost()
Returns the base host of this OX (i.e. the host were the OX was first instantiated). Notice, such host may be different from the OX's current location since the OX may have been migrated to another host.

Returns:
the OX's base host

equals

public boolean equals(java.lang.Object o)
Description copied from class: HierarchicalId
Implements HierarchicalId equality semantics. Two HierarchicalIds are said to be equal if the equality holds for their local IDs, types and parent IDs respectively. This is a reference implementation. Subclasses are highly encouraged to overwrite this method with faster (optimized) implementations.

Overrides:
equals in class HierarchicalId
Parameters:
o - an Object value
Returns:
true if the given object is equals to this object, false otherwise.

hashCode

public int hashCode()
Description copied from class: HierarchicalId
Implements the hash code semantics for HierarchicalId objects so that those object would be used as keys in a java.util Hashtable. This is a reference implementation. Subclasses are highly encouraged to overwrite this method with faster (optimized) implementations.

Overrides:
hashCode in class HierarchicalId
Returns:
a hash code for this object

getType

protected final java.lang.String getType()
Description copied from class: HierarchicalId
Subclasses must overwrite this method and return a String representation of the ID's type.

Specified by:
getType in class HierarchicalId
Returns:
a String value

getLocalId

protected final java.lang.Object getLocalId()
Description copied from class: HierarchicalId
Subclasses must overwrite this method and return an Object representation of the local id. Notice that, subclasses may actually store such ID using primitive types, in order to be more efficient, and just wrap such values in an Object when getLocalId() is invoked.

Specified by:
getLocalId in class HierarchicalId
Returns:
an Object value