com.sapportals.wcm.util.uuid
Class UUID
java.lang.Object
com.sapportals.wcm.util.uuid.UUID
- All Implemented Interfaces:
- Comparable, Serializable
- 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]. |
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
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
- 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].
- Returns:
- Description of the Return Value
hashCode
public int hashCode()
- Generate a hash code of the uuid.
- Returns:
- Description of the Return Value
Copyright 2006 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. Oracle is a registered trademark of Oracle Corporation. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc. HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C, World Wide Web Consortium, Massachusetts Institute of Technology. Java is a registered trademark of Sun Microsystems, Inc. JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. MaxDB is a trademark of MySQL AB, Sweden. 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.