jgroup.relacs.types
Class LocalId

java.lang.Object
  extended by jgroup.relacs.types.LocalId
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public final class LocalId
extends java.lang.Object
implements java.io.Externalizable

A LocalId object is used to distinguish multiple local members associated with a single Jgroup daemon. It is comprised of the member number and its EndPoint.

Since:
Jgroup 1.2
Author:
Hein Meling
See Also:
Serialized Form

Field Summary
static int SIZE
          Size of this object in bytes
 
Constructor Summary
LocalId()
          Default constructor for externalization
LocalId(int member, EndPoint membEndPoint)
          Creates a LocalId object containing the specified member number, and member EndPoint address.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Returns true if and only if the given object is a non-null LocalId object, whose member number and endpoint address is equal to this object.
 EndPoint getEndpoint()
           
 int getMemberNo()
           
 int hashCode()
          Returns a hashcode for this LocalId object.
 void readExternal(java.io.ObjectInput in)
          Restores the content of this object from the marshalled data contained in the specified input stream.
 java.lang.String toString()
          Returns a string representation of this LocalId.
 void writeExternal(java.io.ObjectOutput out)
          Marshals the content of this object to the specified output stream.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SIZE

public static final int SIZE
Size of this object in bytes

See Also:
Constant Field Values
Constructor Detail

LocalId

public LocalId()
Default constructor for externalization


LocalId

public LocalId(int member,
               EndPoint membEndPoint)
Creates a LocalId object containing the specified member number, and member EndPoint address.

Method Detail

getEndpoint

public EndPoint getEndpoint()

getMemberNo

public int getMemberNo()

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Restores the content of this object from the marshalled data contained in the specified input stream.

Specified by:
readExternal in interface java.io.Externalizable
Parameters:
in - the stream to be read
Throws:
java.io.IOException
java.lang.ClassNotFoundException

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Marshals the content of this object to the specified output stream.

Specified by:
writeExternal in interface java.io.Externalizable
Parameters:
out - the stream to be written
Throws:
java.io.IOException

equals

public boolean equals(java.lang.Object obj)
Returns true if and only if the given object is a non-null LocalId object, whose member number and endpoint address is equal to this object. Otherwise, false is returned.

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Returns a hashcode for this LocalId object.

Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Returns a string representation of this LocalId.

Overrides:
toString in class java.lang.Object


Copyright © 1998-2006 The Jgroup/ARM development team. All Rights Reserved.