|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.eaio.uuid.UUID
public class UUID
Creates UUIDs according to the DCE Universal Token Identifier specification.
All you need to know:
UUID u = new UUID();
| Field Summary | |
|---|---|
long |
clockSeqAndNode
The clock sequence and node field of the UUID. |
long |
time
The time field of the UUID. |
| Constructor Summary | |
|---|---|
UUID()
Constructor for UUID. |
|
UUID(CharSequence s)
Parses a textual representation of a UUID. |
|
UUID(long time,
long clockSeqAndNode)
Constructor for UUID. |
|
UUID(UUID u)
Copy constructor for UUID. |
|
| Method Summary | |
|---|---|
Object |
clone()
Clones this UUID. |
int |
compareTo(UUID t)
Compares this UUID to another Object. |
boolean |
equals(Object obj)
Compares two Objects for equality. |
long |
getClockSeqAndNode()
Returns the clock and node field of the UUID (lower 64 bits). |
long |
getTime()
Returns the time field of the UUID (upper 64 bits). |
int |
hashCode()
Returns a hash code of this UUID. |
static UUID |
nilUUID()
Returns the nil UUID (a UUID whose values are both set to zero). |
Appendable |
toAppendable(Appendable a)
Appends a String representation of this object to the given Appendable object. |
String |
toString()
Returns this UUID as a String. |
StringBuffer |
toStringBuffer(StringBuffer in)
Appends a String representation of this to the given StringBuffer or
creates a new one if none is given. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public long time
public long clockSeqAndNode
| Constructor Detail |
|---|
public UUID()
UUIDGen.newTime(),
UUIDGen.getClockSeqAndNode()
public UUID(long time,
long clockSeqAndNode)
long values.
time - the upper 64 bitsclockSeqAndNode - the lower 64 bitspublic UUID(UUID u)
u - the UUID, may not be nullpublic UUID(CharSequence s)
No validation is performed. If the CharSequence is shorter than 36 characters,
ArrayIndexOutOfBoundsExceptions will be thrown.
s - the CharSequence, may not be null| Method Detail |
|---|
public int compareTo(UUID t)
ClassCastException if
the other Object is not an instance of the UUID class. Returns a value
smaller than zero if the other UUID is "larger" than this UUID and a value
larger than zero if the other UUID is "smaller" than this UUID.
compareTo in interface Comparable<UUID>t - the other UUID, may not be null
ClassCastExceptionComparable.compareTo(java.lang.Object)public final String toString()
toString in class ObjectnullObject.toString(),
toAppendable(Appendable)public StringBuffer toStringBuffer(StringBuffer in)
StringBuffer or
creates a new one if none is given.
in - the StringBuffer to append to, may be null
nulltoAppendable(Appendable)public Appendable toAppendable(Appendable a)
Appendable object.
For reasons I'll probably never understand, Sun has decided to have a number of I/O classes implement
Appendable which forced them to destroy an otherwise nice and simple interface with IOExceptions.
I decided to ignore any possible IOExceptions in this method.
a - the Appendable object, may be null
StringBuilder if a is nullpublic int hashCode()
hashCode in class Objectint representing the hash codeObject.hashCode()public Object clone()
clone in class Objectnullpublic final long getTime()
public final long getClockSeqAndNode()
public boolean equals(Object obj)
equals in class Objectobj - the Object to compare this UUID with, may be null
true if the other Object is equal to this UUID,
false if notObject.equals(Object)public static UUID nilUUID()
Starting with version 2.0, this method does return a new UUID instance every time it is called. Earlier versions returned one instance. This has now been changed because this UUID has public, non-final instance fields. Returning a new instance is therefore more safe.
null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||