|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tangosol.util.Base
com.tangosol.util.UUID
public final class UUID
A UUID is a 256-bit identifier that, if it is generated, is statistically guaranteed to be unique.
Constructor Summary | |
---|---|
UUID()
Generate a UUID. |
|
UUID(byte[] ab)
Construct a UUID from a byte array. |
|
UUID(DataInput stream)
Construct a UUID from a stream. |
|
UUID(long lDatetime,
byte[] abIP,
int nPort,
int nCount)
Build a UUID from its constituent members (advanced constructor). |
|
UUID(long lDatetime,
InetAddress addr,
int nPort,
int nCount)
Build a UUID from its constituent members (advanced constructor). |
|
UUID(String s)
Construct a UUID from a String. |
Method Summary | |
---|---|
int |
compareTo(Object o)
Compares this object with the specified object for order. |
boolean |
equals(Object o)
Determine if two UUIDs are equal. |
byte[] |
getAddress()
Determine the internet address of the host that generated the UUID instance. |
int |
getCount()
Determine the "counter" portion of the UUID that ensures that two UUIDs generated at the same exact time by the same process are unique. |
int |
getPort()
Determine the port portion of the UUID. |
long |
getTimestamp()
Determine the date/time value that the UUID instance was generated. |
int |
hashCode()
Determine a hash code for the UUID object. |
boolean |
isAddressIncluded()
This is true if the IP address is a real IP address. |
boolean |
isGenerated()
This is true if the UUID was generated, and false if it was built. |
static void |
main(String[] asArgs)
Allow UUID identifiers to be generated or parsed at the command line. |
void |
readExternal(DataInput in)
Restore the contents of this object by loading the object's state from the passed DataInput object. |
void |
readExternal(ObjectInput in)
Read this object from an ObjectInputStream. |
void |
readExternal(PofReader in)
Restore the contents of a user type instance by reading its state using the specified PofReader object. |
byte[] |
toByteArray()
Convert the UUID to a byte array of 32 bytes. |
String |
toString()
Convert the UUID to a printable String. |
void |
writeExternal(DataOutput out)
Save the contents of this object by storing the object's state into the passed DataOutput object. |
void |
writeExternal(ObjectOutput out)
Write this object to an ObjectOutputStream. |
void |
writeExternal(PofWriter out)
Save the contents of a POF user type instance by writing its state using the specified PofWriter object. |
Constructor Detail |
---|
public UUID()
public UUID(long lDatetime, InetAddress addr, int nPort, int nCount)
It is guaranteed that a generated UUID will never equal a built UUID.
lDatetime
- the creation date/time millis portion of the UUIDaddr
- the InetAddress portion of the UUIDnPort
- the port number portion of the UUID; a port number
is 16 bits, but up to 28 bits of data from this value
will be maintained by the UUIDnCount
- the counter portion of the UUIDpublic UUID(long lDatetime, byte[] abIP, int nPort, int nCount)
It is guaranteed that a generated UUID will never equal a built UUID.
lDatetime
- the creation date/time millis portion of the UUIDabIP
- the InetAddress portion of the UUIDnPort
- the port number portion of the UUID; a port number
is 16 bits, but up to 28 bits of data from this value
will be maintained by the UUIDnCount
- the counter portion of the UUIDpublic UUID(String s)
s
- a String as would be returned from UUID.toString()public UUID(byte[] ab)
ab
- a byte array as would be returned from UUID.toByteArray()public UUID(DataInput stream) throws IOException
This is a helper constructor that is just a shorthand for a sequence:
UUID uid = new UUID(); uid.readExternal(stream);
stream
- an object implementing java.io.DataInput that contains
the internal information that a previous UID wrote
IOException
- if an error occurs reading from the streamMethod Detail |
---|
public static void main(String[] asArgs)
public boolean isGenerated()
public long getTimestamp()
public boolean isAddressIncluded()
public byte[] getAddress()
public int getPort()
public int getCount()
public byte[] toByteArray()
public String toString()
public boolean equals(Object o)
o
- the other UUID
public int compareTo(Object o)
compareTo
in interface Comparable
o
- the Object to be compared.
ClassCastException
- if the specified object's type prevents it
from being compared to this Objectpublic int hashCode()
public void readExternal(ObjectInput in) throws IOException
readExternal
in interface Externalizable
in
- the ObjectInputStream to read this object from
IOException
- if an exception occurs reading this objectpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
out
- the ObjectOutputStream to write this object to
IOException
- thrown if an exception occurs writing this objectpublic void readExternal(DataInput in) throws IOException
readExternal
in interface ExternalizableLite
in
- the DataInput stream to read data from in order to restore
the state of this object
IOException
- if an I/O exception occurs
NotActiveException
- if the object is not in its initial
state, and therefore cannot be deserialized intopublic void writeExternal(DataOutput out) throws IOException
writeExternal
in interface ExternalizableLite
out
- the DataOutput stream to write the state of this object to
IOException
- if an I/O exception occurspublic void readExternal(PofReader in) throws IOException
readExternal
in interface PortableObject
in
- the PofReader from which to read the object's state
IOException
- if an I/O error occurspublic void writeExternal(PofWriter out) throws IOException
writeExternal
in interface PortableObject
out
- the PofWriter to which to write the object's state
IOException
- if an I/O error occurs
|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |