|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectunsw.cse.mica.agent.Message
public class Message
A representation of the messages that the blackboard sends. This is useful as a way of internally passing these messages around or storing them.
Field Summary | |
---|---|
static java.lang.String |
TYPE_DELETEDMOB
A constant string to indicate that the message is a handleDeletedMob message |
static java.lang.String |
TYPE_NEWMOB
A constant string to indicate that the message is a handleNewMob message |
static java.lang.String |
TYPE_REPLACEDMOB
|
static java.lang.String |
TYPE_TYPEMANAGERCHANGED
A constant string to indicate that the message is a handleTypeManagerchanged message |
Constructor Summary | |
---|---|
Message(java.lang.String type)
Create a new Message object with the given type. |
|
Message(java.lang.String type,
Mob mob)
Create a new Message object with the given type and mob. |
|
Message(java.lang.String type,
Mob mob1,
Mob mob2)
Create a new Message object with the given type and mobs. |
Method Summary | |
---|---|
Mob |
getMob1()
Get the mob associated with this message |
Mob |
getMob2()
|
java.lang.String |
getType()
Get the type of this message |
boolean |
isDeletedMob()
See if this message is a TYPE_DELETEDMOB message |
boolean |
isNewMob()
See if this message is a TYPE_NEWMOB message |
boolean |
isReplacedMob()
See if this message is a TYPE_REPLACEDMOB message |
boolean |
isTypeManagerChanged()
See if this message is a TYPE_TYPEMANAGERCHANGED message |
java.lang.String |
toString()
Get a string representation of this message |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String TYPE_NEWMOB
handleNewMob
message
public static final java.lang.String TYPE_DELETEDMOB
handleDeletedMob
message
public static final java.lang.String TYPE_REPLACEDMOB
public static final java.lang.String TYPE_TYPEMANAGERCHANGED
handleTypeManagerchanged
message
Constructor Detail |
---|
public Message(java.lang.String type)
TYPE_TYPEMANAGERCHANGED
messages.
type
- The type for this message. Should be TYPE_TYPEMANAGERCHANGED
public Message(java.lang.String type, Mob mob)
TYPE_NEWMOB
and TYPE_DELETEDMOB
messages.
type
- The type for this messagemob
- The mob that caused this messagepublic Message(java.lang.String type, Mob mob1, Mob mob2)
TYPE_REPLACEDMOB
messages.
type
- The type for this messagemob1
- the mob that caused this messagemob2
- another mob that this message relates toMethod Detail |
---|
public java.lang.String getType()
public boolean isNewMob()
TYPE_NEWMOB
message
TYPE_NEWMOB
message, false otherwisepublic boolean isDeletedMob()
TYPE_DELETEDMOB
message
TYPE_DELETEDMOB
message, false otherwisepublic boolean isReplacedMob()
TYPE_REPLACEDMOB
message
TYPE_REPLACEDMOB
message, false otherwisepublic boolean isTypeManagerChanged()
TYPE_TYPEMANAGERCHANGED
message
TYPE_TYPEMANAGERCHANGED
message, false otherwisepublic Mob getMob1()
public Mob getMob2()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |