JXTA

net.jxta.share
Class UUID

java.lang.Object
  |
  +--net.jxta.share.UUID

public class UUID
extends java.lang.Object
implements java.lang.Cloneable

UUID implementation based on a psuedo-random number generator.


Constructor Summary
UUID()
          Creates a new UUID using the default random number generator.
UUID(java.util.Random random)
          Creates a new UUID using the specified pseudo-random number generator.
UUID(java.lang.String s)
          Creates a new UUID parse from the specified string.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Returns true if this UUID is equal to the specified object.
 int hashCode()
          Returns the hash code value for this UUID.
static void setRandom(java.util.Random r)
          Sets the default random number generator to use when creating new UUID's.
 java.lang.String toString()
          Returns the string specification of this UUID.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UUID

public UUID()
Creates a new UUID using the default random number generator. If a default random number generator has not already been set then a new instance of SecureRandom will be used and set as the default.

UUID

public UUID(java.util.Random random)
Creates a new UUID using the specified pseudo-random number generator.

UUID

public UUID(java.lang.String s)
Creates a new UUID parse from the specified string.
Method Detail

setRandom

public static void setRandom(java.util.Random r)
Sets the default random number generator to use when creating new UUID's. This method must be called before any UUID's are created and may only be called once.

toString

public java.lang.String toString()
Returns the string specification of this UUID.
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Returns the hash code value for this UUID.
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Returns true if this UUID is equal to the specified object.
Overrides:
equals in class java.lang.Object

JXTA