com.xavax.xstore
Class LOID

Object
  extended byLOID
All Implemented Interfaces:
Comparable

public class LOID
extends Object
implements Comparable

LOID is the Logical Object IDentifier for a persistent object. A LOID consists of a database ID, a class ID, and an object ID (OID). The OID uniquely identifies a persistent object in an environment. An object migrating from one database to another would retain its unique identity while the database ID would be adjusted to reflect the migration. The class ID and database ID are included in the OID to allow performance optimizations in the persistence mechanism.


Constructor Summary
LOID(short databaseID, short classID, long objectID)
          Construct a LOID.
 
Method Summary
 short classID()
          Returns the class identifier of this LOID.
 int compareTo(Object loid)
          Compare two LOIDs.
 short databaseID()
          Returns the database identifier of this LOID.
 boolean equals(LOID loid)
          Returns true if two LOIDs are equal.
 long oid()
          Returns the object identifier of this LOID.
 String toString()
          Returns a string representation of this LOID.
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LOID

public LOID(short databaseID,
            short classID,
            long objectID)
Construct a LOID.

Parameters:
databaseID - the database identifier.
classID - the class identifier.
objectID - the object identifier.
Method Detail

compareTo

public int compareTo(Object loid)
              throws NullPointerException
Compare two LOIDs. Only the object identifiers participate in the comparison.

Specified by:
compareTo in interface Comparable
Parameters:
loid - the LOID to be compared with this LOID.
Returns:
a value of 0 if the LOIDs are equal, -1 if this LOID is less than loid, or +1 if this LOID is greater than loid.
Throws:
NullPointerException - if loid is null.

equals

public boolean equals(LOID loid)
Returns true if two LOIDs are equal. Only the object identifiers participate in the comparison.

Parameters:
loid - the LOID to be compared with this LOID.
Returns:
true if the LOIDs are equal.

databaseID

public short databaseID()
Returns the database identifier of this LOID.

Returns:
a database identifier.

classID

public short classID()
Returns the class identifier of this LOID.

Returns:
a class identifier.

oid

public long oid()
Returns the object identifier of this LOID.

Returns:
an object identifier.

toString

public String toString()
Returns a string representation of this LOID.

Returns:
a string representing this LOID.