java.rmi.server
Class UID

java.lang.Object
  extended by java.rmi.server.UID
All Implemented Interfaces:
Serializable

public final class UID
extends Object
implements Serializable

Represents the unique identifier over time for the host which has generated it. It contains time (when created), counter (the number of the UID creation order) and virtual machine id components. The UID can also be constructed specifying a "well known" identifier in the for of short: this identifier defines the UID uniqueness alone.

See Also:
Serialized Form

Constructor Summary
UID()
          Create the new UID that would have the described features of the uniqueness.
UID(short wellKnownId)
          Create the new UID with the well known id (number).
 
Method Summary
 boolean equals(Object other)
          Compare this UID with another UID for equality (not equal to other types of objects).
 int hashCode()
          Get the hashCode of this UID.
static UID read(DataInput in)
           
 String toString()
          Get the string representation of this UID.
 void write(DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UID

public UID()
Create the new UID that would have the described features of the uniqueness.


UID

public UID(short wellKnownId)
Create the new UID with the well known id (number). All UIDs, creates with the this constructor having the same parameter are equal to each other (regardless to the host and time where they were created.

Parameters:
wellKnownId - the well known UID.
Method Detail

hashCode

public int hashCode()
Get the hashCode of this UID.

Overrides:
hashCode in class Object
Returns:
the hash code for this Object
See Also:
Object.equals(Object), System.identityHashCode(Object)

equals

public boolean equals(Object other)
Compare this UID with another UID for equality (not equal to other types of objects).

Overrides:
equals in class Object
Parameters:
other - the Object to compare to
Returns:
whether this Object is semantically equal to another
See Also:
Object.hashCode()

read

public static UID read(DataInput in)
                throws IOException
Throws:
IOException

write

public void write(DataOutput out)
           throws IOException
Throws:
IOException

toString

public String toString()
Get the string representation of this UID.

Overrides:
toString in class Object
Returns:
a string, uniquely identifying this id.
See Also:
Object.getClass(), Object.hashCode(), Class.getName(), Integer.toHexString(int)