|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.core.QUuid
public class QUuid
The QUuid class stores a Universally Unique Identifier (UUID).
For objects or declarations that must be uniquely identified, UUIDs (also known as GUIDs) are widely used in order to assign a fixed and easy to compare value to the object or declaration. The 128-bit value of a UUID is generated by an algorithm that guarantees that the value is unique.
In Qt, UUIDs are wrapped by the QUuid struct which provides convenience functions for handling UUIDs. Most platforms provide a tool to generate new UUIDs, for example, uuidgen and guidgen.
UUIDs generated by QUuid, are based on the Random version of the DCE (Distributed Computing Environment) standard.
UUIDs can be constructed from numeric values or from strings, or using the static createUuid function. They can be converted to a string with toString. UUIDs have a variant and a version, and null UUIDs return true from isNull.
Nested Class Summary | |
---|---|
static class |
QUuid.Variant
This enum defines the variant of the UUID, which is the scheme which defines the layout of the 128-bits value. |
static class |
QUuid.Version
This enum defines the version of the UUID. |
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.AbstractSignal, QSignalEmitter.Signal0, QSignalEmitter.Signal1<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I> |
Constructor Summary | |
---|---|
QUuid()
Creates the null UUID {00000000-0000-0000-0000-000000000000}. |
|
QUuid(int l,
char w1,
char w2,
byte b1,
byte b2,
byte b3,
byte b4,
byte b5,
byte b6,
byte b7,
byte b8)
Creates a UUID with the value specified by the parameters, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8. |
|
QUuid(java.lang.String arg__1)
Creates a QUuid object from the string arg__1. |
Method Summary | |
---|---|
int |
compareTo(java.lang.Object other)
|
static QUuid |
createUuid()
Returns a new UUID of DCE variant, and Random type. |
int |
data1()
Returns the data of this QUuid. |
char |
data2()
Returns the data of this QUuid. |
char |
data3()
Returns the data of this QUuid. |
byte[] |
data4()
Returns the data of this QUuid. |
boolean |
equals(java.lang.Object other)
|
static QUuid |
fromNativePointer(QNativePointer nativePointer)
This function returns the QUuid instance pointed to by nativePointer |
boolean |
isNull()
Returns true if this is the null UUID {00000000-0000-0000-0000-000000000000}; otherwise returns false. |
static QNativePointer |
nativePointerArray(QUuid[] array)
This function returns a QNativePointer that is pointing to the specified QUuid array. |
void |
readFrom(QDataStream arg__1)
Reads a QUuid from arg__1. |
void |
setData1(int data1)
Sets the data of this QUuid to data1. |
void |
setData2(char data2)
Sets the data of this QUuid to data2. |
void |
setData3(char data3)
Sets the data of this QUuid to data3. |
void |
setData4(byte[] data4)
Sets the data of this QUuid to data4. |
java.lang.String |
toString()
Returns the string representation of the uuid. |
QUuid.Variant |
variant()
Returns the variant of the UUID. |
QUuid.Version |
version()
Returns the version of the UUID, if the UUID is of the DCE variant; otherwise returns VerUnknown. |
void |
writeTo(QDataStream arg__1)
Writes thisQUuid to arg__1. |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread |
Methods inherited from class java.lang.Object |
---|
clone, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Constructor Detail |
---|
public QUuid(java.lang.String arg__1)
Creates a QUuid object from the string arg__1. The function can only convert a string in the format {HHHHHHHH-HHHH-HHHH-HHHH-HHHHHHHHHHHH} (where 'H' stands for a hex digit). If the conversion fails a null UUID is created.
public QUuid()
Creates the null UUID {00000000-0000-0000-0000-000000000000}.
public QUuid(int l, char w1, char w2, byte b1, byte b2, byte b3, byte b4, byte b5, byte b6, byte b7, byte b8)
Creates a UUID with the value specified by the parameters, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8.
Example:
// {67C8770B-44F1-410A-AB9A-F9B5446F13EE}
QUuid IID_MyInterface(0x67c8770b, 0x44f1, 0x410a, 0xab, 0x9a, 0xf9, 0xb5, 0x44, 0x6f, 0x13, 0xee)
Method Detail |
---|
public final boolean isNull()
Returns true if this is the null UUID {00000000-0000-0000-0000-000000000000}; otherwise returns false.
public final void writeTo(QDataStream arg__1)
public final void readFrom(QDataStream arg__1)
public final java.lang.String toString()
Returns the string representation of the uuid.
toString
in class java.lang.Object
public final QUuid.Variant variant()
Returns the variant of the UUID. The null UUID is considered to be of an unknown variant.
public final QUuid.Version version()
Returns the version of the UUID, if the UUID is of the DCE variant; otherwise returns VerUnknown.
public static QUuid createUuid()
Returns a new UUID of DCE variant, and Random type. The UUIDs generated are based on the platform specific pseudo-random generator, which is usually not a cryptographic-quality random number generator. Therefore, a UUID is not guaranteed to be unique cross application instances.
On Windows, the new UUID is extremely likely to be unique on the same or any other system, networked or not.
public final void setData1(int data1)
public final int data1()
public final void setData2(char data2)
public final char data2()
public final void setData3(char data3)
public final char data3()
public final void setData4(byte[] data4)
public final byte[] data4()
public static QUuid fromNativePointer(QNativePointer nativePointer)
nativePointer
- the QNativePointer of which object should be returned.public static QNativePointer nativePointerArray(QUuid[] array)
array
- the array that the returned pointer will point to.
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int compareTo(java.lang.Object other)
compareTo
in interface java.lang.Comparable
|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |