org.dspace.app.didl
Class UUID

java.lang.Object
  extended by org.dspace.app.didl.UUID
All Implemented Interfaces:
Serializable

public final class UUID
extends Object
implements Serializable

This class implements UUID version 4. The values for the various fields are crypto random values set by the factory class UUIDFactory Development of this code was part of the aDORe repository project by the Research Library of the Los Alamos National Laboratory. This code is based on the implementation of UUID version 4 (the one that uses random/pseudo-random numbers by Ashraf Amrou of the Old Dominion University (Aug 14, 2003)

See Also:
Serialized Form

Constructor Summary
UUID(long _hi, long _lo)
          Construct a Version 4 UUID object form the two given long values.
UUID(UUID uuid)
          Construct a Version 4 UUID object from another UUID object
 
Method Summary
 boolean equals(Object obj)
          Compare UUID objects
 int hashCode()
          Generate a hash for the UUID
 String toString()
          Obtain a string representation of the UUID object
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UUID

public UUID(UUID uuid)
Construct a Version 4 UUID object from another UUID object

Parameters:
uuid - the UUID to use as a base for the new UUID

UUID

public UUID(long _hi,
            long _lo)
Construct a Version 4 UUID object form the two given long values. These values are (pseudo)random numbers (best if crypto quality)

Parameters:
_hi - first long value
_lo - second long value
Method Detail

equals

public boolean equals(Object obj)
Compare UUID objects

Overrides:
equals in class Object
Parameters:
obj - the object to compare this UUID against
Returns:
true or false

hashCode

public int hashCode()
Generate a hash for the UUID

Overrides:
hashCode in class Object
Returns:
hash code for the UUID

toString

public String toString()
Obtain a string representation of the UUID object

Overrides:
toString in class Object
Returns:
the string representation of this UUID


Copyright © 2013 DuraSpace. All Rights Reserved.