pluginCore
Class Message

java.lang.Object
  extended by pluginCore.Message

public class Message
extends Object

The base object for communication between plugins.


Field Summary
 Object anObject
          An object that is to be sent to another plug-in.
 int destID
          The id of the plug-in that is to receive this message.
 int intMessage
          The integer value of a message in the protocol defined by 'protocol'.
 Message next
          Used when plug-ins wish to store linked lists of messages.
 int protocol
          The protocol that is being used for this communication.
static int PROTOCOL_A
          Communication protocol A.
static int PROTOCOL_B
          Communication protocol B.
static int PROTOCOL_C
          Communication protocol C.
 int sourceID
          The id of the plug-in that sent this message.
 
Constructor Summary
Message()
          Blank constructor, ever value is set to 0.
Message(int srcID, int deID, int proto, int msg)
          Constructor for regular Message.
Message(int srcID, int destID, int proto, int msg, Object par)
          Constructor for regular Message with object parameters.
 
Method Summary
 Object getAnObject()
          Gets the Object that was carried by the Message.
 int getDest()
          Gets the destination plug-in Id.
 int getIntMessage()
          Gets the integer message.
 Message getNextMessage()
          Gets the next Message.
 int getProtocol()
          Gets the message protocol.
 int getSource()
          Gets the source plug-in Id.
 void setAnObject(Object objIn)
          Sets the Object array that will be carried by the Message.
 void setDest(int newDest)
          Sets the destination plug-in Id.
 void setIntMessage(int msgIn)
          Sets the integer message.
 void setNextMessage(Message messIn)
          Sets the next Message.
 void setProtocol(int proto)
          Sets the message protocol.
 void setSource(int newSource)
          Sets the source plug-in Id.
 String toString()
          Returns a String representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROTOCOL_A

public static final int PROTOCOL_A
Communication protocol A.

See Also:
Constant Field Values

PROTOCOL_B

public static final int PROTOCOL_B
Communication protocol B.

See Also:
Constant Field Values

PROTOCOL_C

public static final int PROTOCOL_C
Communication protocol C.

See Also:
Constant Field Values

sourceID

public int sourceID
The id of the plug-in that sent this message.


destID

public int destID
The id of the plug-in that is to receive this message.


protocol

public int protocol
The protocol that is being used for this communication.


intMessage

public int intMessage
The integer value of a message in the protocol defined by 'protocol'.


anObject

public Object anObject
An object that is to be sent to another plug-in.


next

public Message next
Used when plug-ins wish to store linked lists of messages.

Constructor Detail

Message

public Message()
Blank constructor, ever value is set to 0.


Message

public Message(int srcID,
               int deID,
               int proto,
               int msg)
Constructor for regular Message.

Parameters:
srcID - The id of the originating plug-in.
deID - The id of the destination plug-in.
proto - The protocol with which this message is communicating.
msg - The integer value of the message.

Message

public Message(int srcID,
               int destID,
               int proto,
               int msg,
               Object par)
Constructor for regular Message with object parameters.

Parameters:
srcID - The id of the originating plug-in.
destID - The id of the destination plug-in.
proto - The protocol with which this message is communicating.
msg - The integer value of the message.
par - The Object payload of the message.
Method Detail

setDest

public void setDest(int newDest)
Sets the destination plug-in Id.

Parameters:
newDest - The destination plug-in Id.

getDest

public int getDest()
Gets the destination plug-in Id.

Returns:
The destination plug-in Id.

setSource

public void setSource(int newSource)
Sets the source plug-in Id.

Parameters:
newSource - The source plug-in Id.

getSource

public int getSource()
Gets the source plug-in Id.

Returns:
The source plug-in Id.

setAnObject

public void setAnObject(Object objIn)
Sets the Object array that will be carried by the Message.

Parameters:
objIn - An array of objects to be sent with the Message.

getAnObject

public Object getAnObject()
Gets the Object that was carried by the Message.

Returns:
An object sent with the Message or null.

setIntMessage

public void setIntMessage(int msgIn)
Sets the integer message.

Parameters:
msgIn - The integer message.

getIntMessage

public int getIntMessage()
Gets the integer message.

Returns:
The integer message.

setProtocol

public void setProtocol(int proto)
Sets the message protocol.

Parameters:
proto - The message protocol.

getProtocol

public int getProtocol()
Gets the message protocol.

Returns:
The message protocol.

setNextMessage

public void setNextMessage(Message messIn)
Sets the next Message.

Parameters:
messIn - The next message in the linked list.

getNextMessage

public Message getNextMessage()
Gets the next Message.

Returns:
The next message in the linked list.

toString

public String toString()
Returns a String representation of this object.

Overrides:
toString in class Object