FileDocCategorySizeDatePackage
UniqueId.javaAPI DocApache Tomcat 6.0.142313Fri Jul 20 04:20:36 BST 2007org.apache.catalina.tribes

UniqueId

public final class UniqueId extends Object implements Serializable

Title: Represents a globabally unique Id

Company:

author
Filip Hanik
version
1.0

Fields Summary
protected byte[]
id
Constructors Summary
public UniqueId()

    
public UniqueId(byte[] id)

        this.id = id;
    
public UniqueId(byte[] id, int offset, int length)

        this.id = new byte[length];
        System.arraycopy(id,offset,this.id,0,length);
    
Methods Summary
public booleanequals(java.lang.Object other)

        boolean result = (other instanceof UniqueId);
        if ( result ) {
            UniqueId uid = (UniqueId)other;
            if ( this.id == null && uid.id == null ) result = true;
            else if ( this.id == null && uid.id != null ) result = false;
            else if ( this.id != null && uid.id == null ) result = false;
            else result = Arrays.equals(this.id,uid.id);
        }//end if
        return result;
    
public byte[]getBytes()

        return id;
    
public inthashCode()

        if ( id == null ) return 0;
        return Arrays.hashCode(id);
    
public java.lang.StringtoString()

        StringBuffer buf = new StringBuffer("UniqueId");
        buf.append(org.apache.catalina.tribes.util.Arrays.toString(id));
        return buf.toString();