nl.tudelft.simulation.messaging
Class Message

java.lang.Object
  extended bynl.tudelft.simulation.messaging.Message
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class Message
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

A message, which can be sent from a sender to a receiver with some content. The Message is actually the 'envelope' around the content of the message. Messages are exchanged between devices. The Serializable content that is part of the message, needs to be handled by separate, domain specific, content handlers.

Copyright (c) 2003-2005 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information www.simulation.tudelft.nl . The source code and binary code of this software is proprietary information of Delft University of Technology.

Version:
$$Revision: 1.3 $$ $$Date: 2005/04/08 11:29:13 $$
Author:
Peter Jacobs , Stijn-Pieter van Houten , Alexander Verbraeck
See Also:
Serialized Form

Constructor Summary
Message(ActorInterface sender, ActorInterface receiver, double timestamp, int priority, java.io.Serializable body, long id)
          constructs a new message
Message(ActorInterface sender, ActorInterface receiver, java.io.Serializable body)
          constructs a new Message
 
Method Summary
 java.io.Serializable getBody()
           
 long getId()
           
 int getPriority()
           
 ActorInterface getReceiver()
           
 ActorInterface getSender()
           
 double getTimestamp()
           
 void setBody(java.io.Serializable body)
          sets the body of a message
 void setId(long id)
          sets the id of a message
 void setPriority(int priority)
          sets the priority of the message
 void setReceiver(ActorInterface receiver)
          sets the receiver of the message
 void setTimestamp(double timestamp)
          sets the timestamp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Message

public Message(ActorInterface sender,
               ActorInterface receiver,
               double timestamp,
               int priority,
               java.io.Serializable body,
               long id)
constructs a new message

Parameters:
sender - the sender
receiver - the receiver
timestamp - the timestamp
priority - the priority
body - the body
id - the id

Message

public Message(ActorInterface sender,
               ActorInterface receiver,
               java.io.Serializable body)
constructs a new Message

Parameters:
sender - the sender
receiver - the receiver
body - the body
Method Detail

getSender

public ActorInterface getSender()
Returns:
the sender of the message

getReceiver

public ActorInterface getReceiver()
Returns:
the receiver or the group of receivers of the message

getTimestamp

public double getTimestamp()
Returns:
the timestamp of the message

getPriority

public int getPriority()
Returns:
the message priority

getBody

public java.io.Serializable getBody()
Returns:
the body of the message

getId

public long getId()
Returns:
Returns the id.

setId

public void setId(long id)
sets the id of a message

Parameters:
id - The id to set.

setBody

public void setBody(java.io.Serializable body)
sets the body of a message

Parameters:
body - The body to set.

setPriority

public void setPriority(int priority)
sets the priority of the message

Parameters:
priority - The priority to set.

setReceiver

public void setReceiver(ActorInterface receiver)
sets the receiver of the message

Parameters:
receiver - The receiver to set.

setTimestamp

public void setTimestamp(double timestamp)
sets the timestamp

Parameters:
timestamp - The timestamp to set.


Copyright © 2004-2005 Delft University of Technology, the Netherlands. All Rights Reserved.