org.exolab.core.foundation
Class ObjectId

java.lang.Object
  extended by org.exolab.core.foundation.ObjectId
All Implemented Interfaces:
java.io.Serializable

public class ObjectId
extends java.lang.Object
implements java.io.Serializable

This class defines a unique identifier for the object in a particular datastore. It uses a long to represnet the identity of persistent objects

Version:
$version$
Author:
jima
See Also:
PersistentObject, Serialized Form

Constructor Summary
ObjectId()
          The default constructore is used to instantiate an instance of this class without initializing the id attribute
ObjectId(long id)
          Construct an object with the specified id
 
Method Summary
 boolean equals(java.lang.Object object)
          Determine whether the specified object is oequal to this object.
 long getId()
          Return the object identifier
 int hashCode()
          The hashcode is used to identify elements in the hastable.
 void setId(long id)
          Set the object identifier
 java.lang.String toString()
          Return a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ObjectId

public ObjectId()
The default constructore is used to instantiate an instance of this class without initializing the id attribute


ObjectId

public ObjectId(long id)
Construct an object with the specified id

Parameters:
id - identity of the object
Method Detail

setId

public void setId(long id)
Set the object identifier

Parameters:
id -

getId

public long getId()
Return the object identifier

Returns:
long

equals

public boolean equals(java.lang.Object object)
Determine whether the specified object is oequal to this object. Equality implies that their id and version are identical

Overrides:
equals in class java.lang.Object
Parameters:
object - the object to test against
Returns:
boolean return true if it is equals and false otherwise

toString

public java.lang.String toString()
Return a string representation of this object.

Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
The hashcode is used to identify elements in the hastable. The hashcode is an exclusive or of the top 4 bytes and the bottom 4 bytes

Overrides:
hashCode in class java.lang.Object
Returns:
int


Copyright © 1999-2012 The Exolab Group. All Rights Reserved.