transport.protocol
Class Message

java.lang.Object
  |
  +--transport.protocol.Message
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
MulticastMessage, NMEAMessage

public abstract class Message
extends java.lang.Object
implements java.io.Serializable

This class defines the basic structure for a message used to send data between agents in the simulation.

See Also:
Serialized Form

Field Summary
private  int from
          The port number of who sent the message.
private  int to
          The port number to whom the message is being sent.
 
Constructor Summary
Message(int to, int from)
          This constructor initializes the Message.
 
Method Summary
 int getFrom()
          This method returns the port that the sender listens to.
 int getTo()
          This method returns the port to send the message to.
 void setTo(int t)
          This method sets the port to send the message to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

from

private int from
The port number of who sent the message.


to

private int to
The port number to whom the message is being sent.

Constructor Detail

Message

public Message(int to,
               int from)
This constructor initializes the Message.

Method Detail

getFrom

public int getFrom()
This method returns the port that the sender listens to.

Returns:
int The port number.

getTo

public int getTo()
This method returns the port to send the message to.

Returns:
int The port number.

setTo

public void setTo(int t)
This method sets the port to send the message to.

Returns:
int The port number.