cat.sig
Class Agent

java.lang.Object
  extended bycat.sig.Agent
All Implemented Interfaces:
java.io.Serializable

public class Agent
extends java.lang.Object
implements java.io.Serializable

This class represents an Agent in CAT. And agent is merely a person running CAT, or in other words is a single device running CAT. Agent is then a way to identify the different people/devices using CAT.

See Also:
Serialized Form

Field Summary
private  java.lang.String host
          the host that the agent is on.
private  java.lang.String id
          the id of the agent.
private  int port
          the port number the agent communicates on.
private  Profile profile
          Optional information about the agent to share with other agents.
 
Constructor Summary
Agent(java.lang.String id, int port)
          This constructor initializes the agent with basic information about the agent.
Agent(java.lang.String id, int port, Profile p)
          This constructor initializes the agent with basic information about the agent.
Agent(java.lang.String id, int port, java.lang.String host)
          This constructor initializes the agent with basic information about the agent.
Agent(java.lang.String id, int port, java.lang.String host, Profile p)
          This constructor initializes the agent with basic information about the agent.
 
Method Summary
 boolean equals(Agent a)
          returns true if the agents have the same id.
 boolean equals(java.lang.Object o)
          returns true if the agents have the same ID.
 java.lang.String getHost()
          Returns the agents host name.
 java.lang.String getId()
          Returns the agent's id.
 int getPort()
          Returns the agents port number.
 Profile getProfile()
           
 void setProfile(Profile p)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

id

private java.lang.String id
the id of the agent.


port

private int port
the port number the agent communicates on.


host

private java.lang.String host
the host that the agent is on.


profile

private Profile profile
Optional information about the agent to share with other agents.

Constructor Detail

Agent

public Agent(java.lang.String id,
             int port)
This constructor initializes the agent with basic information about the agent.

Parameters:
id - The name of the agent.
port - The port this agent using for communicating with other agents.

Agent

public Agent(java.lang.String id,
             int port,
             java.lang.String host)
This constructor initializes the agent with basic information about the agent.

Parameters:
id - The name of the agent.
port - The port this agent using for communicating with other agents.
host - The host name this agent uses.

Agent

public Agent(java.lang.String id,
             int port,
             java.lang.String host,
             Profile p)
This constructor initializes the agent with basic information about the agent.

Parameters:
id - The name of the agent.
port - The port this agent using for communicating with other agents.
host - The host name this agent uses.

Agent

public Agent(java.lang.String id,
             int port,
             Profile p)
This constructor initializes the agent with basic information about the agent.

Parameters:
id - The name of the agent.
port - The port this agent using for communicating with other agents.
Method Detail

getPort

public int getPort()
Returns the agents port number.

Returns:
int The port.

getId

public java.lang.String getId()
Returns the agent's id.

Returns:
String The id.

getHost

public java.lang.String getHost()
Returns the agents host name.

Returns:
String The host.

equals

public boolean equals(java.lang.Object o)
returns true if the agents have the same ID.

Parameters:
o -
Returns:

equals

public boolean equals(Agent a)
returns true if the agents have the same id.

Parameters:
a -
Returns:

toString

public java.lang.String toString()

getProfile

public Profile getProfile()

setProfile

public void setProfile(Profile p)