Appia Documentation

net.sf.appia.protocols.group
Class Endpt

java.lang.Object
  extended by net.sf.appia.protocols.group.Endpt
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public class Endpt
extends java.lang.Object
implements java.io.Externalizable

Endpt represents a group member, endpoint.
Each member of a group, or groups, has a unique identifier.

Version:
0.1
Author:
Alexandre Pinto
See Also:
ViewState, Serialized Form

Field Summary
 java.lang.String id
          The endpoint identifier.
 
Constructor Summary
Endpt()
          Constructs an anonimous endpoint.
Endpt(java.lang.String name)
          Constructs an endpoint using the given String.
 
Method Summary
 boolean equals(Endpt e)
          Tests if the endpoint represented by the given Endpt is the same one represented by this Endpt.
 boolean equals(java.lang.Object o)
          Redefines Object.equals().
 int hashCode()
          Redefines Object.hashCode().
static Endpt peek(Message message)
           
static Endpt pop(Message message)
           
static void push(Endpt endpt, Message message)
           
 void readExternal(java.io.ObjectInput in)
           
 java.lang.String toString()
          Converts the endpoint to a String.
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

id

public java.lang.String id
The endpoint identifier.

Constructor Detail

Endpt

public Endpt()
Constructs an anonimous endpoint.
The probability of two endpoints created using this constructor being equal, is very small. The endpoint is created by combining the localhost, the current time, and Object.hashCode().


Endpt

public Endpt(java.lang.String name)
Constructs an endpoint using the given String.

Parameters:
name - The name to be used as endpoint identifier.
Method Detail

equals

public boolean equals(Endpt e)
Tests if the endpoint represented by the given Endpt is the same one represented by this Endpt.

Parameters:
e - the other Endpt
Returns:
true if this Endpt and the given Endpt represent the same endpoint, false otherwise

equals

public boolean equals(java.lang.Object o)
Redefines Object.equals().

Overrides:
equals in class java.lang.Object
Parameters:
o - The object to compare.
Returns:
Returns true if this and the given object represent the same endpoint.

toString

public java.lang.String toString()
Converts the endpoint to a String.

Overrides:
toString in class java.lang.Object
Returns:
a String of the endpoint.

hashCode

public int hashCode()
Redefines Object.hashCode().
The hashcode is equal to the identifier hashcode

Overrides:
hashCode in class java.lang.Object
Returns:
hashcode for this Endpt

push

public static void push(Endpt endpt,
                        Message message)

pop

public static Endpt pop(Message message)

peek

public static Endpt peek(Message message)

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException
java.lang.ClassNotFoundException

Appia Documentation

COPYRIGHT 2006-2009, University of Lisbon and INESC-ID
For updates and related information please see Appia Home Page
Send questions, sugestions or remarks to the appia-users mailing list