|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectMessage
public class Message
This class represents the messages sent and received by LPs.
Nested Class Summary | |
---|---|
static class |
Message.MsgType
Constants representing categories of messages that can be sent. |
Field Summary | |
---|---|
(package private) java.lang.Object |
content
Message content |
(package private) Message.MsgType |
msgType
Type of the message, matching one of the constants defined in this class. |
(package private) java.lang.String |
receiverAPPid
Receiver's APPid , if receiver is a
LogicalProcess , or identifier, if receiver is a monitoring/steering
application. |
(package private) int |
receiverLP
Receiver's LP number |
(package private) java.lang.String |
receiverMN
Receiver's machine name |
(package private) int |
receiverPE
Receiver's PE number |
(package private) java.lang.String |
senderAPPid
Sender's APPid , if sender is a
LogicalProcess , or identifier, if sender is a monitoring/steering
application. |
(package private) int |
senderLP
Sender's LP number |
(package private) int |
senderPE
Sender's PE number |
(package private) int |
tag
Tag that indicate whether this message has already been acknowledged by the receiver |
(package private) int |
timeStamp
(Simulation) time this message should occur. |
Constructor Summary | |
---|---|
Message(int time,
Message.MsgType typ,
java.lang.Object cont)
Preferred constructor; constructs a Message object of undefined origin and destination. |
|
Message(int time,
Message.MsgType typ,
java.lang.Object cont,
java.lang.String sender,
java.lang.String receiver)
Constructs a Message object with preliminary (not complete) addressing. |
Method Summary | |
---|---|
int |
compareTo(Message O)
Compares two Messages' time stamps. |
java.lang.Object |
getContent()
Returns the content of the message. |
Message.MsgType |
getMsgType()
Returns the type of the message. |
java.lang.String |
getReceiverAPPid()
Returns the receiver name. |
int |
getReceiverLP()
gets the receiver LP. |
java.lang.String |
getReceiverMN()
Returns the machine name of the receive of this message. |
int |
getReceiverPE()
Returns the PE id of the receiver of the message. |
java.lang.String |
getSenderAPPid()
Returns the sender name. |
int |
getSenderLP()
gets the sender LP. |
double |
getTimeStamp()
Returns the time stamp of the message. |
(package private) Message |
makeAntiMsg()
Returns a copy of the passed-in message with a negative sign. |
(package private) void |
setMsgType(Message.MsgType typ)
Sets the message type; |
(package private) void |
setReceiverAPPid(java.lang.String raid)
Sets the receiver APPid. |
(package private) void |
setReceiverLP(int rLP)
Sets the receiver's LP number. |
(package private) void |
setReceiverMN(java.lang.String mn)
Sets the machine name of the receiver of this message. |
(package private) void |
setReceiverPE(int rPE)
Sets the receiver's PE number. |
(package private) void |
setSenderAPPid(java.lang.String said)
Sets the sender APPid. |
(package private) void |
setSenderLP(int sLP)
Sets the sender's LP number. |
(package private) void |
setSenderPE(int sPE)
Sets the sender's PE number. |
java.lang.String |
toString()
Returns a string representation of the Message object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
int tag
Message.MsgType msgType
int timeStamp
java.lang.Object content
java.lang.String senderAPPid
APPid
, if sender is a
LogicalProcess
, or identifier, if sender is a monitoring/steering
application.
int senderLP
int senderPE
java.lang.String receiverAPPid
APPid
, if receiver is a
LogicalProcess
, or identifier, if receiver is a monitoring/steering
application.
int receiverLP
int receiverPE
java.lang.String receiverMN
Constructor Detail |
---|
public Message(int time, Message.MsgType typ, java.lang.Object cont)
time
- The local sim time this message occurs.typ
- MsgType of this Message.cont
- Object the content of the message.public Message(int time, Message.MsgType typ, java.lang.Object cont, java.lang.String sender, java.lang.String receiver)
time
- The local sim time this message occurs.typ
- MsgType of this Message.cont
- Object the content of the message.sender
- String the APPid of the sender LP.receiver
- String the APPid of the receiver LP.Method Detail |
---|
void setReceiverMN(java.lang.String mn)
mn
- a String object representing the machine name.public java.lang.String getReceiverMN()
void setMsgType(Message.MsgType typ)
typ
- MsgTypeMessage makeAntiMsg()
public int getReceiverPE()
void setSenderPE(int sPE)
sPE
- int the PE where the sender resides.void setSenderLP(int sLP)
sLP
- int the LP id of the sender.void setReceiverPE(int rPE)
rPE
- int the PE where the receiver resides.void setReceiverLP(int rLP)
rLP
- int the id of the receiver LP.void setSenderAPPid(java.lang.String said)
void setReceiverAPPid(java.lang.String raid)
public int getReceiverLP()
public int getSenderLP()
public java.lang.String getSenderAPPid()
public java.lang.String getReceiverAPPid()
public Message.MsgType getMsgType()
public double getTimeStamp()
public java.lang.Object getContent()
public java.lang.String toString()
toString
in class java.lang.Object
public int compareTo(Message O)
compareTo
in interface java.lang.Comparable<Message>
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |