de.janrufmonitor.util.uuid
Class UUID

java.lang.Object
  extended by de.janrufmonitor.util.uuid.UUID
All Implemented Interfaces:
Serializable, Comparable

public class UUID
extends Object
implements Serializable, Comparable

See Also:
Serialized Form

Constructor Summary
UUID()
           
UUID(byte[] node)
           
UUID(String str)
           
 
Method Summary
 int compareTo(Object withUUID)
           
 boolean equals(Object toUUID)
          Compare two UUIDs
 int getClockSequence()
          Get the clock sequence number.
 byte[] getNode()
          Get the spatially unique portion of the UUID.
 long getTime()
          Get the temporal unique portion of the UUID.
 byte[] getUUID()
          Get the 128 bit UUID.
 int getVersion()
          Get the UUID version number.
 int hashCode()
          Generate a hash code of the uuid.
 String toString()
          Provide a String representation of a UUID as specified in section 3.5 of [leach].
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UUID

public UUID()

UUID

public UUID(String str)
     throws NumberFormatException
Throws:
NumberFormatException

UUID

public UUID(byte[] node)
Method Detail

compareTo

public int compareTo(Object withUUID)
Specified by:
compareTo in interface Comparable

getClockSequence

public int getClockSequence()
Get the clock sequence number.

Returns:
the clock sequence number

getNode

public byte[] getNode()
Get the spatially unique portion of the UUID. This is either the 48 bit IEEE 802 host address, or if on is not available, a random number that will not conflict with any IEEE 802 host address.

Returns:
node portion of the UUID

getTime

public long getTime()
Get the temporal unique portion of the UUID.

Returns:
the time portion of the UUID

getUUID

public byte[] getUUID()
Get the 128 bit UUID.

Returns:
The uUID value

getVersion

public int getVersion()
Get the UUID version number.

Returns:
The version value

equals

public boolean equals(Object toUUID)
Compare two UUIDs

Overrides:
equals in class Object
Parameters:
toUUID - Description of the Parameter
Returns:
true if the UUIDs are equal

toString

public String toString()
Provide a String representation of a UUID as specified in section 3.5 of [leach].

Overrides:
toString in class Object
Returns:
Description of the Return Value

hashCode

public int hashCode()
Generate a hash code of the uuid.

Overrides:
hashCode in class Object
Returns:
Description of the Return Value


Copyright © 2010 by Thilo Brandt. All Rights Reserved.