EDU.gatech.cc.is.communication
Class Message

java.lang.Object
  |
  +--EDU.gatech.cc.is.communication.Message
Direct Known Subclasses:
AckMessage, LongMessage, PositionMessage, RegisterMessage, ReinforcementMessage, StringMessage, TerminateMessage

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

message communicated to/from a robot.

Copyright (c)1998 Tucker Balch

See Also:
Serialized Form

Field Summary
static int BROADCAST
          Message type.
static int MULTICAST
          Message type.
 int[] receivers
          IDs of the receivers.
 int sender
          the ID of the sender.
 int type
          the type of message.
static int UNICAST
          Message type.
 
Constructor Summary
Message()
          create a Message with default values.
 
Method Summary
 java.lang.Object clone()
          clone the message
static void main(java.lang.String[] args)
          test the Message class.
 java.lang.String paramString()
          return a printable String representation of the Message.
 java.lang.String toString()
          return a printable String representation of the Message.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BROADCAST

public static final int BROADCAST
Message type.

MULTICAST

public static final int MULTICAST
Message type.

UNICAST

public static final int UNICAST
Message type.

type

public int type
the type of message. Default is BROADCAST.

sender

public int sender
the ID of the sender. Ranges from 1 to the number of agents in the group.

receivers

public int[] receivers
IDs of the receivers. Ignored for broadcast messages.
Constructor Detail

Message

public Message()
create a Message with default values.
Method Detail

toString

public java.lang.String toString()
return a printable String representation of the Message.
Overrides:
toString in class java.lang.Object
Returns:
the String representation

paramString

public java.lang.String paramString()
return a printable String representation of the Message.
Returns:
the String representation

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
clone the message
Overrides:
clone in class java.lang.Object
Returns:
the clone
Throws:
java.lang.CloneNotSupportedException - if it isn't supported.

main

public static void main(java.lang.String[] args)
test the Message class.