| 
 | Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
   com.tangosol.util.Base
com.tangosol.util.Base
       com.tangosol.util.UID
com.tangosol.util.UID
public class UID
A UID is a 128-bit identifier that is almost guaranteed to be unique.
| Constructor Summary | |
|---|---|
| UID()Construct a UID (default constructor). | |
| UID(byte[] ab)Construct a UID from a byte array. | |
| UID(java.io.DataInput stream)Construct a UID from a stream. | |
| UID(int nAddr, long lDatetime, int nCount)Construct a UID from its constituent members (advanced constructor). | |
| UID(java.lang.String s)Construct a UID from a String. | |
| Method Summary | |
|---|---|
|  int | compareTo(java.lang.Object o)Compares this object with the specified object for order. | 
|  boolean | equals(java.lang.Object o)Determine if two UIDs are equal. | 
|  int | getAddress()Determine the internet address of the host that generated the UID instance (or a random number if no internet address was available) | 
|  int | getCount()Determine the "counter" portion of the UID that ensures that two UIDs generated at the same exact time by the same process are unique. | 
|  long | getTimestamp()Determine the date/time value that the UID instance was generated. | 
|  int | hashCode()Determine a hash code for the UID object. | 
| static void | main(java.lang.String[] asArgs)Allow UID identifiers to be generated or parsed at the command line. | 
|  void | readExternal(java.io.DataInput in)Restore the contents of this object by loading the object's state from the passed DataInput object. | 
|  void | readExternal(PofReader in)Restore the contents of a user type instance by reading its state using the specified PofReader object. | 
|  void | save(java.io.DataOutput stream)Store this UID in a stream. | 
|  byte[] | toByteArray()Convert the UID to a byte array of 16 bytes. | 
|  char[] | toCharArray()Convert the UID to a character array of 32 hex digits. | 
| static long | toLong(java.net.InetAddress addr)Converts and IP address to a long value. | 
|  java.lang.String | toString()Convert the UID to a printable String. | 
| static java.lang.String | toString(long l)Converts a long value to an address string in the form returned by InetAddress#getHostAddress. | 
|  void | writeExternal(java.io.DataOutput out)Save the contents of this object by storing the object's state into the passed DataOutput object. | 
|  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 UID()
public UID(int nAddr,
           long lDatetime,
           int nCount)
nAddr - the InetAddress-related portion of the UIDlDatetime - the creation date/time millis portion of the UIDnCount - the counter portion of the UIDpublic UID(byte[] ab)
ab - a byte array as would be returned from UID.toByteArray()public UID(java.lang.String s)
s - a String as would be returned from UID.toString()
public UID(java.io.DataInput stream)
    throws java.io.IOException
stream - an object implementing java.io.DataInput that contains the internal information that a previous UID wrotejava.io.IOException - if an error occurs reading from the stream| Method Detail | 
|---|
public static void main(java.lang.String[] asArgs)
public int getAddress()
public long getTimestamp()
public int getCount()
public java.lang.String toString()
public byte[] toByteArray()
public char[] toCharArray()
public boolean equals(java.lang.Object o)
o - the other UIDpublic int compareTo(java.lang.Object o)
compareTo in interface java.lang.Comparableo - the Object to be compared.java.lang.ClassCastException - if the specified object's type prevents it from being compared to this Objectpublic int hashCode()
public void save(java.io.DataOutput stream)
          throws java.io.IOException
stream - an object implementing java.io.DataOutput that this UID should write its internal information to.java.io.IOException - if an error occurs writing to the stream
public void readExternal(java.io.DataInput in)
                  throws java.io.IOException
readExternal in interface ExternalizableLitein - the DataInput stream to read data from in order to restore the state of this objectjava.io.IOException - if an I/O exception occursjava.io.NotActiveException - if the object is not in its initial state, and therefore cannot be deserialized into
public void writeExternal(java.io.DataOutput out)
                   throws java.io.IOException
writeExternal in interface ExternalizableLiteout - the DataOutput stream to write the state of this object tojava.io.IOException - if an I/O exception occurs
public void readExternal(PofReader in)
                  throws java.io.IOException
readExternal in interface PortableObjectin - the PofReader from which to read the object's statejava.io.IOException - if an I/O error occurs
public void writeExternal(PofWriter out)
                   throws java.io.IOException
writeExternal in interface PortableObjectout - the PofWriter to which to write the object's statejava.io.IOException - if an I/O error occurspublic static long toLong(java.net.InetAddress addr)
addr - an instance of InetAddress to convert to a longpublic static java.lang.String toString(long l)
l - the long value holding the IP address| 
 | Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||