|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metamatrix.core.id.UUID
public class UUID
This class represents a universally unique identifier, consisting of two long integral values.
This identifier is supposed to be unique both spatially and temporally. It is based on version 4 IETF variant random UUIDs.
Field Summary | |
---|---|
static int |
FQ_LENGTH
|
static java.lang.String |
PROTOCOL
|
static java.lang.String |
PROTOCOL_UCASE
|
Fields inherited from interface com.metamatrix.core.id.ObjectID |
---|
DELIMITER |
Constructor Summary | |
---|---|
UUID(long mostSig,
long leastSig)
Construct an instance of this class from two long integral values. |
|
UUID(java.util.UUID uuid)
|
Method Summary | |
---|---|
int |
compareTo(java.lang.Object obj)
Compares this object to another. |
boolean |
equals(java.lang.Object obj)
Returns true if the specified object is semantically equal to this instance. |
java.lang.String |
exportableForm()
Returns a 36-character string of six fields separated by hyphens, with each field represented in lowercase hexadecimal with the same number of digits as in the field. |
static long |
getPart1(ObjectID id)
Return the first part of the UUID as a long. |
static long |
getPart2(ObjectID id)
Return the first part of the UUID as a long. |
java.lang.String |
getProtocol()
Return the name of the protocol that this factory uses. |
static int |
getVariant(ObjectID id)
|
static int |
getVersion(ObjectID id)
|
int |
hashCode()
Returns the hashcode for this instance. |
static ObjectID |
stringToObject(java.lang.String value)
Attempt to convert the specified string to the appropriate ObjectID instance. |
java.lang.String |
toString()
Returns a string representing the current state of the object. |
java.lang.String |
toString(char delim)
Returns a string representing the current state of the object. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PROTOCOL
public static final java.lang.String PROTOCOL_UCASE
public static final int FQ_LENGTH
Constructor Detail |
---|
public UUID(long mostSig, long leastSig)
java.lang.IllegalArgumentException
- if either value is negativepublic UUID(java.util.UUID uuid)
Method Detail |
---|
public static long getPart1(ObjectID id)
public static long getPart2(ObjectID id)
public static int getVariant(ObjectID id)
public static int getVersion(ObjectID id)
public java.lang.String getProtocol()
getProtocol
in interface ObjectID
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
Returns true if the specified object is semantically equal to this
instance. Note: this method is consistent with compareTo()
.
UUID instances are equal if they represent the same 128-bit value.
equals
in class java.lang.Object
obj
- the object that this instance is to be compared to.
public int compareTo(java.lang.Object obj)
Compares this object to another. If the specified object is not an instance of the LongID class, then this method throws a ClassCastException (as instances are comparable only to instances of the same class).
Note: this method is consistent with equals()
,
meaning that (compare(x, y)==0) == (x.equals(y))
.
compareTo
in interface ObjectID
compareTo
in interface java.lang.Comparable
obj
- the object that this instance is to be compared to; may not be null.
java.lang.ClassCastException
- if the specified object's type prevents it
from being compared to this instance.public java.lang.String toString()
toString
in interface ObjectID
toString
in class java.lang.Object
public java.lang.String toString(char delim)
ObjectID
toString
in interface ObjectID
delim
- the delimiter that should be used
ObjectID.toString(char)
public java.lang.String exportableForm()
Returns a 36-character string of six fields separated by hyphens, with each field represented in lowercase hexadecimal with the same number of digits as in the field. The order of fields is: time_low, time_mid, version and time_hi treated as a single field, variant and clock_seq treated as a single field, and node.
public static ObjectID stringToObject(java.lang.String value) throws InvalidIDException
value
- the stringified id with the protocol and ObjectID.DELIMITER already
removed, and which is never null or zero length
InvalidIDException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |