agent
Class User

java.lang.Object
  |
  +--agent.Agent
        |
        +--agent.User

public class User
extends Agent

This class represents a user on the map. A user is an agent which has a corresponding ipaq application that it sends data to via a port & socket. When a user changes location it sends its new gps position to its port so that the ipaq application can get it.


Field Summary
private  int port
          The port to open a socket and send data to.
 
Fields inherited from class agent.Agent
 
Constructor Summary
User(int p)
          This constructor initializes the user.
User(java.awt.Point l, int p)
          This constructor initializes the user.
User(java.lang.String n, java.awt.Point l, int p)
          This constructor initializes the user.
 
Method Summary
 int getPort()
          This method returns the port this user is using.
 void setPort(int p)
          This method sets the port to be used by this user.
 
Methods inherited from class agent.Agent
getLocation, getName, getPosition, getRange, setLocation, setName, setPosition, setRange
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

port

private int port
The port to open a socket and send data to.

Constructor Detail

User

public User(java.lang.String n,
            java.awt.Point l,
            int p)
This constructor initializes the user.

Parameters:
n - The name of the user.
l - The starting location of this user on the map.
p - The port the ipaq gps receiver is listening on.

User

public User(java.awt.Point l,
            int p)
This constructor initializes the user.

Parameters:
l - The starting location of this user on the map.
p - The port the ipaq gps receiver is listening on.

User

public User(int p)
This constructor initializes the user.

Parameters:
p - The port the ipaq gps receiver is listening on.
Method Detail

getPort

public int getPort()
This method returns the port this user is using.

Returns:
int The port this user uses to send data to ipaq application.

setPort

public void setPort(int p)
This method sets the port to be used by this user.

Parameters:
p - The port to set this user to use.