|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.netbeans.mdr.persistence.btreeimpl.btreestorage.UUID
public class UUID
UUID is a DCE UUID, that is, a 128-bit universally unique identifier.
The UUID has the following fields:
Time is expressed as in VMS, i.e. 100's of nanoseconds since a base date, but the base dat is 10/15/1582, rather than VMS's 1858. Since 100 nanoseconds is probably much smaller than the system clock resolution, implementations are allowed to construct many UUIDs per clock tick by keeping track of a 'time adjustment', which is bumped for each UUID constructed during a clock tick and added into the UUID's time fields.
The intent of the UUID algorithm is to generate a globally unique ID. The reasoning goes:
Java has one large problem using this logic: the Ethernet address is not findable in any documented way. The DCE implementation on SunOS evidently has had the same problem, since they use the Internet address instead of the Ethernet address as four bytes of their node ID (they set the fifth and sixth bytes not to conflict with any true Ethernet address.)
Forte's version of UUID generation, implemented in the UUID.UUIDGenerator class, is:
Field Summary | |
---|---|
static int |
STRING_LENGTH
the length of a UUID converted to a string |
Constructor Summary | |
---|---|
UUID()
Generate a new UUID |
|
UUID(java.lang.String str)
Create a UUID from a string |
Method Summary | |
---|---|
int |
compareTo(java.lang.Object o)
Orders UUIDs by their field values |
boolean |
equals(java.lang.Object o)
Two UUIDs are equal if all of their fields are equal |
int |
hashCode()
Use timeLow for the hashCode, so equal UUIDs hash equal |
java.lang.String |
toString()
Convert a UUID to a string in standard form: |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int STRING_LENGTH
Constructor Detail |
---|
public UUID()
public UUID(java.lang.String str) throws java.lang.NumberFormatException
str
- A string in standard UUID format
java.lang.NumberFormatException
- Thrown if the string isn't
a valid UUID.Method Detail |
---|
public java.lang.String toString()
XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
timeLow-timeMid-timeHiAndVersion-clockSeqAndReserved-nodeId
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public int hashCode()
hashCode
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |