com.sapportals.wcm.util.uuid

Class UUID

java.lang.Object
  extended by com.sapportals.wcm.util.uuid.UUID
All Implemented Interfaces:
Serializable, Comparable

public class UUID
extends Object
implements Serializable, Comparable

A Universally Unique Identifier (UUID) is a 128 bit number generated according to an algorithm that is garanteed to be unique in time and space from all other UUIDs. It consists of an IEEE 802 Internet Address and various time stamps to ensure uniqueness. For a complete specification, see ftp://ietf.org/internet-drafts/draft-leach-uuids-guids-01.txt [leach].

Copyright (c) SAP AG 2001-2002

See Also:
Serialized Form

Constructor Summary
UUID()
          Generate a UUID for this host using version 1 of [leach].
UUID(byte[] node)
          Generate a UUID for this host using version 1 of [leach].
UUID(String str)
          Create a UUID from its string representation.
 
Method Summary
 int compareTo(Object withUUID)
          Lexically compare this UUID with 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()
Generate a UUID for this host using version 1 of [leach].


UUID

public UUID(byte[] node)
Generate a UUID for this host using version 1 of [leach].

Parameters:
node - the node to use in the UUID

UUID

public UUID(String str)
     throws NumberFormatException
Create a UUID from its string representation. Not that getClockSequence, getTime, getVersion and getNode might return nonsense since the internal structure of the UUID will not be checked.

Parameters:
str - The string representation of the uuid
Throws:
NumberFormatException - if uuid is invalid
Method Detail

compareTo

public int compareTo(Object withUUID)
Lexically compare this UUID with withUUID. Note: lexical ordering is not temporal ordering.

Specified by:
compareTo in interface Comparable
Parameters:
withUUID - the UUID to compare with
Returns:
  • -1 if this UUID is less than withUUID
  • 0 if this UUID is equal to withUUID
  • 1 if this UUID is greater than withUUID

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
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] KMC-CM [sap.com] tc/km/frwk api EP-KM-CM
[sap.com] KMC-WPC [sap.com] tc/kmc/wpc/wpcfacade api EP-PIN-WPC-WCM


Copyright 2014 SAP AG Complete Copyright Notice