|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.util.id.UID
public class UID
A unique identifier (uniqueness only guarantied inside of the virtual machine in which it was created).
The identifier is composed of:
[ time ] - [ counter ]
Numbers are converted to radix(Character.MAX_RADIX) when converting to strings.
This should provide adequate uniqueness for most purposes.
Field Summary | |
---|---|
protected static EDU.oswego.cs.dl.util.concurrent.SynchronizedLong |
COUNTER
A counter for generating identity values |
protected long |
id
The identity portion of the UID |
protected long |
time
The time portion of the UID |
Constructor Summary | |
---|---|
|
UID()
Construct a new UID. |
protected |
UID(UID uid)
Copy a UID. |
Method Summary | |
---|---|
static String |
asString()
Returns a UID as a string. |
Object |
clone()
Returns a copy of this UID. |
boolean |
equals(Object obj)
Checks if the given object is equal to this UID. |
long |
getID()
Get the identity portion of this UID. |
long |
getTime()
Get the time portion of this UID. |
int |
hashCode()
Return the hash code of this UID. |
String |
toString()
Return a string representation of this UID. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final EDU.oswego.cs.dl.util.concurrent.SynchronizedLong COUNTER
protected final long time
protected final long id
Constructor Detail |
---|
public UID()
protected UID(UID uid)
Method Detail |
---|
public final long getTime()
public final long getID()
public String toString()
toString
in class Object
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
obj
- Object to test equality with.
public Object clone()
clone
in class Object
public static String asString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |