Save This Page
Home » openjdk-7 » java » rmi » server » [javadoc | source]
java.rmi.server
public final class: UID [javadoc | source]
java.lang.Object
   java.rmi.server.UID

All Implemented Interfaces:
    Serializable

A UID represents an identifier that is unique over time with respect to the host it is generated on, or one of 216 "well-known" identifiers.

The #UID() constructor can be used to generate an identifier that is unique over time with respect to the host it is generated on. The #UID(short) constructor can be used to create one of 216 well-known identifiers.

A UID instance contains three primitive values:

An independently generated UID instance is unique over time with respect to the host it is generated on as long as the host requires more than one millisecond to reboot and its system clock is never set backward. A globally unique identifier can be constructed by pairing a UID instance with a unique host identifier, such as an IP address.

Constructor:
 public UID() 
 public UID(short num) 
Method from java.rmi.server.UID Summary:
equals,   hashCode,   read,   toString,   write
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from java.rmi.server.UID Detail:
 public boolean equals(Object obj) 
    Compares the specified object with this UID for equality. This method returns true if and only if the specified object is a UID instance with the same unique, time, and count values as this one.
 public int hashCode() 
    Returns the hash code value for this UID.
 public static UID read(DataInput in) throws IOException 
    Constructs and returns a new UID instance by unmarshalling a binary representation from an DataInput instance.

    Specifically, this method first invokes the given stream's DataInput#readInt() method to read a unique value, then it invoke's the stream's DataInput#readLong() method to read a time value, then it invoke's the stream's DataInput#readShort() method to read a count value, and then it creates and returns a new UID instance that contains the unique, time, and count values that were read from the stream.

 public String toString() 
    Returns a string representation of this UID.
 public  void write(DataOutput out) throws IOException