Class Message

java.lang.Object
  |
  +--Message
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
TextMessage

public class Message
extends Object
implements Cloneable

Basic message; can be subclassed for message types (which can have bodies). Make sure that any subclass deals with clone() correctly; if there are instance variables that refer to mutable objects, they need to be recursively cloned.

Version:
2002-04-16
Author:
Max Hailperin

Constructor Summary
Message(int source, int destination)
          Constructor for objects of class Message
 
Method Summary
 Object clone()
          Be sure to override this in subclasses if necessary.
 int getDestination()
          returns the Message's destination address
 int getSource()
          returns the Message's source address
 String toString()
          returns a String describing the Message
 
Methods inherited from class java.lang.Object
, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Message

public Message(int source,
               int destination)
Constructor for objects of class Message
Parameters:
source - address of source Port
destination - address of destination Port(s)
Method Detail

clone

public Object clone()
Be sure to override this in subclasses if necessary.
Overrides:
clone in class Object
Returns:
a copy of the Message

getDestination

public int getDestination()
returns the Message's destination address
Returns:
the Message's destination address

getSource

public int getSource()
returns the Message's source address
Returns:
the Message's source address

toString

public String toString()
returns a String describing the Message
Overrides:
toString in class Object
Returns:
a description of the Message


Generated by BlueJ