SAP NetWeaver '04

com.sap.netweaver.bc.rf.util.uuid
Class UUID

[contained in: com.sap.netweaver.bc.rf.par - bc.rf.util_api.jar]
java.lang.Object
  |
  +--com.sap.netweaver.bc.rf.util.uuid.UUID
All Implemented Interfaces:
java.lang.Comparable, java.io.Serializable

public class UUID
extends java.lang.Object
implements java.io.Serializable, java.lang.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(java.lang.String str)
          Create a UUID from its string representation.
 
Method Summary
 int compareTo(java.lang.Object withUUID)
          Lexically compare this UUID with withUUID.
 boolean equals(java.lang.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.
 java.lang.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(java.lang.String str)
     throws java.lang.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:
java.lang.NumberFormatException - if uuid is invalid
Method Detail

compareTo

public int compareTo(java.lang.Object withUUID)
Lexically compare this UUID with withUUID. Note: lexical ordering is not temporal ordering.
Specified by:
compareTo in interface java.lang.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(java.lang.Object toUUID)
Compare two UUIDs
Overrides:
equals in class java.lang.Object
Parameters:
toUUID - Description of the Parameter
Returns:
true if the UUIDs are equal

toString

public java.lang.String toString()
Provide a String representation of a UUID as specified in section 3.5 of [leach].
Overrides:
toString in class java.lang.Object
Returns:
Description of the Return Value

hashCode

public int hashCode()
Generate a hash code of the uuid.
Overrides:
hashCode in class java.lang.Object
Returns:
Description of the Return Value

SAP NetWeaver '04

Copyright © 2004 by SAP AG. All Rights Reserved.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.