org.opends.server.backends.jeb
Class EntryID

java.lang.Object
  extended by org.opends.server.backends.jeb.EntryID
All Implemented Interfaces:
java.lang.Comparable<EntryID>

public class EntryID
extends java.lang.Object
implements java.lang.Comparable<EntryID>

An integer identifier assigned to each entry in the JE backend. An entry ID is implemented by this class as a long. There are static methods to assign monotonically increasing entry IDs, starting from 1.


Constructor Summary
EntryID(com.sleepycat.je.DatabaseEntry databaseEntry)
          Create a new entry ID object from a value in database format.
EntryID(long id)
          Create a new entry ID object from a given long value.
EntryID(java.lang.Long id)
          Create a new entry ID object from a given Long value.
 
Method Summary
 int compareTo(EntryID that)
          Compares this object with the specified object for order.
 boolean equals(java.lang.Object that)
          Indicates whether some other object is "equal to" this one.
 com.sleepycat.je.DatabaseEntry getDatabaseEntry()
          Get the value of the ID in database format.
 int hashCode()
          Returns a hash code value for the object.
 long longValue()
          Get the value of the entry ID as a long.
 java.lang.String toString()
          Get a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EntryID

public EntryID(long id)
Create a new entry ID object from a given long value.

Parameters:
id - The long value of the ID.

EntryID

public EntryID(java.lang.Long id)
Create a new entry ID object from a given Long value.

Parameters:
id - the Long value of the ID.

EntryID

public EntryID(com.sleepycat.je.DatabaseEntry databaseEntry)
Create a new entry ID object from a value in database format.

Parameters:
databaseEntry - The database value of the ID.
Method Detail

longValue

public long longValue()
Get the value of the entry ID as a long.

Returns:
The entry ID.

getDatabaseEntry

public com.sleepycat.je.DatabaseEntry getDatabaseEntry()
Get the value of the ID in database format.

Returns:
The value of the ID in database format.

compareTo

public int compareTo(EntryID that)
              throws java.lang.ClassCastException
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Specified by:
compareTo in interface java.lang.Comparable<EntryID>
Parameters:
that - the Object to be compared.
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Throws:
java.lang.ClassCastException - if the specified object's type prevents it from being compared to this Object.

equals

public boolean equals(java.lang.Object that)
Indicates whether some other object is "equal to" this one.

Overrides:
equals in class java.lang.Object
Parameters:
that - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.
See Also:
hashCode(), Hashtable

hashCode

public int hashCode()
Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by java.util.Hashtable.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code value for this object.
See Also:
Object.equals(java.lang.Object), Hashtable

toString

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

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this object.