com.planet_ink.coffee_mud.Common
Class DefaultMessage

java.lang.Object
  extended by com.planet_ink.coffee_mud.Common.DefaultMessage
All Implemented Interfaces:
CMCommon, CMMsg, CMObject, java.lang.Cloneable, java.lang.Comparable<CMObject>

public class DefaultMessage
extends java.lang.Object
implements CMMsg


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.Common.interfaces.CMMsg
CMMsg.CheckedMsgResponse, CMMsg.Desc, CMMsg.View
 
Field Summary
protected  MOB myAgent
           
protected  Environmental myTarget
           
protected  Environmental myTool
           
protected  int othersMajorMask
           
protected  int othersMinorType
           
protected  java.lang.String othersMsg
           
protected  int sourceMajorMask
           
protected  int sourceMinorType
           
protected  java.lang.String sourceMsg
           
protected  int targetMajorMask
           
protected  int targetMinorType
           
protected  java.lang.String targetMsg
           
protected  java.util.List<CMMsg> trailMsgs
           
protected  java.util.List<java.lang.Runnable> trailRunnables
           
protected  int value
           
 
Fields inherited from interface com.planet_ink.coffee_mud.Common.interfaces.CMMsg
MAJOR_MASK, MASK_ALWAYS, MASK_CHANNEL, MASK_CNTRLMSG, MASK_DELICATE, MASK_DESCS, MASK_EYES, MASK_HANDS, MASK_INTERMSG, MASK_MAGIC, MASK_MALICIOUS, MASK_MOUTH, MASK_MOVE, MASK_OPTIMIZE, MASK_SOUND, MINOR_MASK, MISC_DESCS, MSG_ACTIVATE, MSG_ADVANCE, MSG_AREAAFFECT, MSG_ATTACKMISS, MSG_BID, MSG_BORROW, MSG_BRINGTOLIFE, MSG_BUY, MSG_CAST, MSG_CAST_ATTACK_SOMANTIC_SPELL, MSG_CAST_ATTACK_VERBAL_SPELL, MSG_CAST_MALICIOUS, MSG_CAST_SOMANTIC_SPELL, MSG_CAST_VERBAL_SPELL, MSG_CLANEVENT, MSG_CLOSE, MSG_COLLISION, MSG_COMMAND, MSG_COMMANDFAIL, MSG_COMMANDREJECT, MSG_CONTEMPLATE, MSG_DAMAGE, MSG_DEACTIVATE, MSG_DEATH, MSG_DELICATE_HANDS_ACT, MSG_DELICATE_SMALL_HANDS_ACT, MSG_DEPOSIT, MSG_DIG, MSG_DISMOUNT, MSG_DISPOSSESS, MSG_DRINK, MSG_DROP, MSG_DUELCHALLENGE, MSG_DUELLOSS, MSG_EAT, MSG_EAT_GROUND, MSG_EMOTE, MSG_ENHANCE, MSG_ENTER, MSG_EXAMINE, MSG_EXPIRE, MSG_EXTINGUISH, MSG_FILL, MSG_FLEE, MSG_FOLLOW, MSG_GET, MSG_GIVE, MSG_GRAVITY, MSG_HANDS, MSG_HEALING, MSG_HOLD, MSG_HUH, MSG_INSTALL, MSG_KNOCK, MSG_LEAVE, MSG_LEGALSTATE, MSG_LEGALWARRANT, MSG_LEVEL, MSG_LIST, MSG_LOCK, MSG_LOGIN, MSG_LOOK, MSG_LOOK_EXITS, MSG_MOUNT, MSG_NOFOLLOW, MSG_NOISE, MSG_NOISYMOVEMENT, MSG_OK_ACTION, MSG_OK_VISUAL, MSG_OPEN, MSG_ORDER, MSG_PANIC, MSG_POSSESS, MSG_POUR, MSG_POWERCURRENT, MSG_PRACTICE, MSG_PREINVOKE, MSG_PULL, MSG_PUSH, MSG_PUT, MSG_QUIETMOVEMENT, MSG_QUIT, MSG_READ, MSG_REBUKE, MSG_RECALL, MSG_RELOAD, MSG_REMOVE, MSG_REPAIR, MSG_RETIRE, MSG_RETREAT, MSG_REWRITE, MSG_ROOMRESET, MSG_SELL, MSG_SERVE, MSG_SHUTDOWN, MSG_SIT, MSG_SITMOVE, MSG_SLEEP, MSG_SNIFF, MSG_SPEAK, MSG_STAND, MSG_STARTUP, MSG_TEACH, MSG_TELL, MSG_THIEF_ACT, MSG_THINK, MSG_THROW, MSG_TRAVEL, MSG_UNLOAD, MSG_UNLOCK, MSG_VALUE, MSG_VIEW, MSG_WASREAD, MSG_WEAPONATTACK, MSG_WEAR, MSG_WEATHER, MSG_WIELD, MSG_WITHDRAW, MSG_WRITE, MSG_WROTE, MSK_CAST, MSK_CAST_MALICIOUS, MSK_CAST_MALICIOUS_SOMANTIC, MSK_CAST_MALICIOUS_VERBAL, MSK_CAST_SOMANTIC, MSK_CAST_VERBAL, MSK_HAGGLE, MSK_MALICIOUS_MOVE, NO_EFFECT, TYP_ACID, TYP_ACTIVATE, TYP_ADVANCE, TYP_AREAAFFECT, TYP_AROMA, TYP_ATTACKMISS, TYP_BID, TYP_BORROW, TYP_BUY, TYP_CAST_SPELL, TYP_CHANNEL, TYP_CLANEVENT, TYP_CLOSE, TYP_COLD, TYP_COLLISION, TYP_COMMAND, TYP_COMMANDFAIL, TYP_COMMANDREJECT, TYP_CONTEMPLATE, TYP_DAMAGE, TYP_DEACTIVATE, TYP_DEATH, TYP_DELICATE_HANDS_ACT, TYP_DEPOSIT, TYP_DIG, TYP_DISEASE, TYP_DISMOUNT, TYP_DISPOSSESS, TYP_DRINK, TYP_DROP, TYP_DUELCHALLENGE, TYP_DUELLOSS, TYP_EAT, TYP_ELECTRIC, TYP_EMOTE, TYP_ENHANCE, TYP_ENTER, TYP_EXAMINE, TYP_EXPCHANGE, TYP_EXPIRE, TYP_EXTINGUISH, TYP_FACTIONCHANGE, TYP_FILL, TYP_FIRE, TYP_FLEE, TYP_FOLLOW, TYP_GAS, TYP_GENERAL, TYP_GET, TYP_GIVE, TYP_GRAVITY, TYP_HANDS, TYP_HEALING, TYP_HOLD, TYP_HUH, TYP_INSTALL, TYP_ITEMGENERATED, TYP_ITEMSGENERATED, TYP_JUSTICE, TYP_KNOCK, TYP_LASER, TYP_LEAVE, TYP_LEGALSTATE, TYP_LEGALWARRANT, TYP_LEVEL, TYP_LIFE, TYP_LIST, TYP_LOCK, TYP_LOGIN, TYP_LOOK, TYP_LOOK_EXITS, TYP_MIND, TYP_MOUNT, TYP_NOFOLLOW, TYP_NOISE, TYP_NOISYMOVEMENT, TYP_OK_ACTION, TYP_OK_VISUAL, TYP_OPEN, TYP_ORDER, TYP_PANIC, TYP_PARALYZE, TYP_POISON, TYP_POSSESS, TYP_POUR, TYP_POWERCURRENT, TYP_PRACTICE, TYP_PREINVOKE, TYP_PULL, TYP_PUSH, TYP_PUT, TYP_QUIETMOVEMENT, TYP_QUIT, TYP_READ, TYP_REBUKE, TYP_RECALL, TYP_RECIPELEARNED, TYP_RELOAD, TYP_REMOVE, TYP_REPAIR, TYP_RETIRE, TYP_RETREAT, TYP_REWRITE, TYP_ROOMRESET, TYP_RPXPCHANGE, TYP_SELL, TYP_SERVE, TYP_SHUTDOWN, TYP_SIT, TYP_SITMOVE, TYP_SLEEP, TYP_SNIFF, TYP_SONIC, TYP_SPEAK, TYP_STAND, TYP_STARTUP, TYP_TEACH, TYP_TELL, TYP_THINK, TYP_THROW, TYP_TRAVEL, TYP_UNDEAD, TYP_UNLOAD, TYP_UNLOCK, TYP_VALUE, TYP_VIEW, TYP_WAND_USE, TYP_WASREAD, TYP_WATER, TYP_WEAPONATTACK, TYP_WEAR, TYP_WEATHER, TYP_WIELD, TYP_WITHDRAW, TYP_WRITE, TYP_WROTE, TYPE_DESCS
 
Constructor Summary
DefaultMessage()
           
 
Method Summary
 CMMsg addTrailerMsg(CMMsg msg)
          Appends to the list of other CMMsg events which are slated to be confirmed and executed AFTER this current message is handled.
 CMMsg addTrailerRunnable(java.lang.Runnable r)
          Appends to the list of Runnable objects which are slated to be confirmed and executed AFTER this current message is handled.
 boolean amISource(MOB thisOne)
          Returns whether the given Environmental object is, in fact, the source of this message.
 boolean amITarget(Environmental thisOne)
          Returns whether the given Environmental object is, in fact, the target of this message.
 int compareTo(CMObject o)
           
 CMObject copyOf()
          Similar to Cloneable.clone(), but does its best to make sure that any internal objects to this class are also copyOfed.
 boolean equals(java.lang.Object o)
           
protected  void finalize()
           
 int hashCode()
           
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
 void initializeClass()
          Called ONCE after all objects are loaded, but before the map is read in during initialization.
 boolean isOthers(Environmental E)
          Returns whether the given Environmental object is neither the source nor the target of this message.
 boolean isOthers(int codeOrMask)
          Returns whether the given code or mask is either the minor code or a part of the major code of the othersCode
 boolean isOthers(java.lang.String codeOrMaskDesc)
          Returns whether the given code or mask string matches the minor code or a part of the major code of the othersCode.
 boolean isOthersMajor(java.lang.String codeOrMaskDesc)
          Returns whether the given code or mask string matches a part of the major code of the othersCode.
 boolean isOthersMinor(java.lang.String codeOrMaskDesc)
          Returns whether the given code or mask string matches the minor sourceCode (Others are everyone not source, not target)
 boolean isSource(Environmental E)
          Returns whether the given Environmental object is, in fact, the source of this message.
 boolean isSource(int codeOrMask)
          Returns whether the given code or mask is either the minor code or a part of the major code of the sourceCode
 boolean isSource(java.lang.String codeOrMaskDesc)
          Returns whether the given code or mask string matches the minor code or a part of the major code of the sourceCode.
 boolean isSourceMajor(java.lang.String codeOrMaskDesc)
          Returns whether the given code or mask string matches a part of the major code of the sourceCode.
 boolean isSourceMinor(java.lang.String codeOrMaskDesc)
          Returns whether the given code or mask string matches the minor sourceCode
 boolean isTarget(Environmental E)
          Returns whether the given Environmental object is, in fact, the target of this message.
 boolean isTarget(int codeOrMask)
          Returns whether the given code or mask is either the minor code or a part of the major code of the targetCode
 boolean isTarget(java.lang.String codeOrMaskDesc)
          Returns whether the given code or mask string matches the minor code or a part of the major code of the targetCode.
 boolean isTargetMajor(java.lang.String codeOrMaskDesc)
          Returns whether the given code or mask string matches a part of the major code of the targetCode.
 boolean isTargetMinor(java.lang.String codeOrMaskDesc)
          Returns whether the given code or mask string matches the minor sourceCode
protected static boolean matches(int major, int minor, int code)
           
protected static boolean matches(int major, int minor, java.lang.String code2)
           
 CMMsg modify(int newAllCode, java.lang.String allMessage)
          Modifies one of more fields in this event.
 CMMsg modify(int newSourceCode, java.lang.String sourceMessage, int newTargetCode, java.lang.String targetMessage, int newOthersCode, java.lang.String othersMessage)
          Modifies one of more fields in this event.
 CMMsg modify(MOB source, Environmental target, Environmental tool, int newSourceCode, int newTargetCode, int newOthersCode, java.lang.String allMessage)
          Modifies one of more fields in this event.
 CMMsg modify(MOB source, Environmental target, Environmental tool, int newAllCode, java.lang.String allMessage)
          Modifies one of more fields in this event.
 CMMsg modify(MOB source, Environmental target, Environmental tool, int newSourceCode, java.lang.String sourceMessage, int newTargetCode, java.lang.String targetMessage, int newOthersCode, java.lang.String othersMessage)
          Modifies one of more fields in this event.
 CMMsg modify(MOB source, Environmental target, Environmental tool, int newAllCode, java.lang.String sourceMessage, java.lang.String targetMessage, java.lang.String othersMessage)
          Modifies one of more fields in this event.
 CMMsg modify(MOB source, Environmental target, int newAllCode, java.lang.String allMessage)
          Modifies one of more fields in this event.
 CMMsg modify(MOB source, int newAllCode, java.lang.String allMessage)
          Modifies one of more fields in this event.
 CMMsg modify(MOB source, int newAllCode, java.lang.String allMessage, int newValue)
          Modifies one of more fields in this event.
 CMMsg modify(java.lang.String allMessage)
          Modifies one of more fields in this event.
 java.lang.String name()
          The displayable name of this object.
 CMObject newInstance()
          Returns a new instance of this class.
 int othersCode()
          A combination bitmask, action type integer that describes information about how this event affects or is perceived by the others of the action.
 int othersMajor()
          Returns high order bitmask for the others code (Others are everyone not source, not target)
 boolean othersMajor(int bitMask)
          Returns whether high order bitmask for the others code is set (Others are everyone not source, not target)
 java.lang.String othersMessage()
          Returns the string seen by the others of the event, and only by the others of the event.
 int othersMinor()
          Returns low order action type integer for the others code (Others are everyone not source, not target)
protected  CMObject parseFlatObject(java.lang.String part, CMClass.CMObjectType preferClass)
           
 void parseFlatString(java.lang.String flat)
          Unserializes this message as well as it reasonably can.
 boolean sameAs(CMMsg E)
          Whether this object instance is functionally identical to the object passed in.
 CMMsg setOthersCode(int code)
          A combination bitmask, action type integer that describes information about how this event affects or is perceived by the others of the action.
 CMMsg setOthersMessage(java.lang.String str)
          Sets the string seen by the others of the event, and only by the others of the event.
 CMMsg setSource(MOB mob)
          Sets the source of this event, a MOB object
 CMMsg setSourceCode(int code)
          A combination bitmask, action type integer that describes information about how this event affects or is perceived by the source of the action.
 CMMsg setSourceMessage(java.lang.String str)
          Sets the string seen by the source of the event, and only by the source of the event.
 CMMsg setTarget(Environmental E)
          Sets the target of this event, an Environmental object
 CMMsg setTargetCode(int code)
          A combination bitmask, action type integer that describes information about how this event affects or is perceived by the target of the action.
 CMMsg setTargetMessage(java.lang.String str)
          Sets the string seen by the target of the event, and only by the target of the event.
 CMMsg setTool(Environmental E)
          Sets the means, item, portal, or otherwise tool that helps the source affect the event upon the target.
 CMMsg setValue(int amount)
          Sets an arbitrary integer value associated with this event.
 MOB source()
          Returns the source of this event, a MOB object
 int sourceCode()
          A combination bitmask, action type integer that describes information about how this event affects or is perceived by the source of the action.
 int sourceMajor()
          Returns high order bitmask for the source code
 boolean sourceMajor(int bitMask)
          Returns whether high order bitmask for the source code is set
 java.lang.String sourceMessage()
          Returns the string seen by the source of the event, and only by the source of the event.
 int sourceMinor()
          Returns low order action type integer for the target code
 Environmental target()
          Returns the target of this event, an Environmental object
 int targetCode()
          A combination bitmask, action type integer that describes information about how this event affects or is perceived by the target of the action.
 int targetMajor()
          Returns high order bitmask for the target code
 boolean targetMajor(int bitMask)
          Returns whether high order bitmask for the target code is set
 java.lang.String targetMessage()
          Returns the string seen by the target of the event, and only by the target of the event.
 int targetMinor()
          Returns low order action type integer for the target code
 java.lang.String toFlatString()
          Serializes this message as well as it reasonably can.
 Environmental tool()
          Returns the means, item, portal, or otherwise tool that helps the source affect the event upon the target.
 java.util.List<CMMsg> trailerMsgs()
          Returns a List of other CMMsg events which are slated to be confirmed and executed AFTER this current message is handled.
 java.util.List<java.lang.Runnable> trailerRunnables()
          Returns a List of other Runnables which are slated to be and executed AFTER this current message is handled.
 int value()
          Returns the arbitrary value integer associated with this event.
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

targetMajorMask

protected int targetMajorMask

sourceMajorMask

protected int sourceMajorMask

othersMajorMask

protected int othersMajorMask

targetMinorType

protected int targetMinorType

sourceMinorType

protected int sourceMinorType

othersMinorType

protected int othersMinorType

targetMsg

protected java.lang.String targetMsg

othersMsg

protected java.lang.String othersMsg

sourceMsg

protected java.lang.String sourceMsg

myAgent

protected MOB myAgent

myTarget

protected Environmental myTarget

myTool

protected Environmental myTool

value

protected int value

trailMsgs

protected java.util.List<CMMsg> trailMsgs

trailRunnables

protected java.util.List<java.lang.Runnable> trailRunnables
Constructor Detail

DefaultMessage

public DefaultMessage()
Method Detail

ID

public java.lang.String ID()
Description copied from interface: CMObject
The CoffeeMud Java Class ID shared by all instances of this object. Unlike the Java Class name, this method does not include package information. However, it must return a String value unique to its class category in the ClassLoader. Class categories include Libraries, Common, Areas, Abilities, Behaviors, CharClasses, Commands, Exits Locales, MOBS, Races, WebMacros, Basic Items, Armor, Weapons, ClanItems, Tech. The name is typically identical to the class name.

Specified by:
ID in interface CMObject
Returns:
the name of this class

name

public java.lang.String name()
Description copied from interface: CMObject
The displayable name of this object. May be modified by phyStats() object. Is derived from the Name().

Specified by:
name in interface CMObject
Returns:
the modified final name of this object on the map.
See Also:
Environmental.Name()

newInstance

public CMObject newInstance()
Description copied from interface: CMObject
Returns a new instance of this class.

Specified by:
newInstance in interface CMObject
Returns:
a new instance of this class

initializeClass

public void initializeClass()
Description copied from interface: CMObject
Called ONCE after all objects are loaded, but before the map is read in during initialization.

Specified by:
initializeClass in interface CMObject

compareTo

public int compareTo(CMObject o)
Specified by:
compareTo in interface java.lang.Comparable<CMObject>

copyOf

public CMObject copyOf()
Description copied from interface: CMObject
Similar to Cloneable.clone(), but does its best to make sure that any internal objects to this class are also copyOfed.

Specified by:
copyOf in interface CMObject
Returns:
a clone of this object

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

modify

public CMMsg modify(MOB source,
                    Environmental target,
                    int newAllCode,
                    java.lang.String allMessage)
Description copied from interface: CMMsg
Modifies one of more fields in this event.

Specified by:
modify in interface CMMsg
Parameters:
source - the source of the event
target - the target of the event
newAllCode - the source, target, and others code
allMessage - the source, target, and others message
Returns:
this
See Also:
CMMsg.source(), CMMsg.target(), CMMsg.sourceCode(), CMMsg.targetCode(), CMMsg.othersCode(), CMMsg.sourceMessage(), CMMsg.targetMessage(), CMMsg.othersMessage()

modify

public CMMsg modify(java.lang.String allMessage)
Description copied from interface: CMMsg
Modifies one of more fields in this event. Sets target and tool to NULL.

Specified by:
modify in interface CMMsg
Parameters:
allMessage - the new source, target, and others message of this event
Returns:
this
See Also:
CMMsg.source(), CMMsg.target(), CMMsg.sourceCode(), CMMsg.targetCode(), CMMsg.othersCode(), CMMsg.sourceMessage(), CMMsg.targetMessage(), CMMsg.othersMessage()

modify

public CMMsg modify(MOB source,
                    int newAllCode,
                    java.lang.String allMessage)
Description copied from interface: CMMsg
Modifies one of more fields in this event. Sets target and tool to NULL.

Specified by:
modify in interface CMMsg
Parameters:
source - the new source of this event
newAllCode - the new source, target, and others code of this event
allMessage - the new source, target, and others message of this event
Returns:
this
See Also:
CMMsg.source(), CMMsg.target(), CMMsg.sourceCode(), CMMsg.targetCode(), CMMsg.othersCode(), CMMsg.sourceMessage(), CMMsg.targetMessage(), CMMsg.othersMessage()

modify

public CMMsg modify(MOB source,
                    int newAllCode,
                    java.lang.String allMessage,
                    int newValue)
Description copied from interface: CMMsg
Modifies one of more fields in this event. Sets target and tool to NULL.

Specified by:
modify in interface CMMsg
Parameters:
source - the new source of this event
newAllCode - the new source, target, and others code of this event
allMessage - the new source, target, and others message of this event
newValue - the new value for this event
Returns:
this
See Also:
CMMsg.source(), CMMsg.target(), CMMsg.sourceCode(), CMMsg.targetCode(), CMMsg.othersCode(), CMMsg.sourceMessage(), CMMsg.targetMessage(), CMMsg.othersMessage(), CMMsg.value()

modify

public CMMsg modify(MOB source,
                    Environmental target,
                    Environmental tool,
                    int newAllCode,
                    java.lang.String allMessage)
Description copied from interface: CMMsg
Modifies one of more fields in this event.

Specified by:
modify in interface CMMsg
Parameters:
source - the new source of this event
target - the new target of this event
tool - the new tool for this event
newAllCode - the new source, target, and others code of this event
allMessage - the new source, target, and others message of this event
Returns:
this
See Also:
CMMsg.source(), CMMsg.target(), CMMsg.sourceCode(), CMMsg.targetCode(), CMMsg.othersCode(), CMMsg.sourceMessage(), CMMsg.targetMessage(), CMMsg.othersMessage()

modify

public CMMsg modify(MOB source,
                    Environmental target,
                    Environmental tool,
                    int newAllCode,
                    java.lang.String sourceMessage,
                    java.lang.String targetMessage,
                    java.lang.String othersMessage)
Description copied from interface: CMMsg
Modifies one of more fields in this event.

Specified by:
modify in interface CMMsg
Parameters:
source - the new source of this event
target - the new target of this event
tool - the new tool for this event
newAllCode - the new source, target, and others code of this event
sourceMessage - the new source message for this event
targetMessage - the new target message for this event
othersMessage - the new others message for this event
Returns:
this
See Also:
CMMsg.source(), CMMsg.target(), CMMsg.sourceCode(), CMMsg.targetCode(), CMMsg.othersCode(), CMMsg.sourceMessage(), CMMsg.targetMessage(), CMMsg.othersMessage()

setSourceCode

public CMMsg setSourceCode(int code)
Description copied from interface: CMMsg
A combination bitmask, action type integer that describes information about how this event affects or is perceived by the source of the action.

Specified by:
setSourceCode in interface CMMsg
Parameters:
code - the new full bitmask/action type source event code
Returns:
this
See Also:
CMMsg.source(), CMMsg.sourceMessage(), CMMsg.sourceCode(), CMMsg.sourceMajor(int), CMMsg.sourceMinor(), CMMsg.MASK_MAGIC, CMMsg.TYP_CAST_SPELL

setTargetCode

public CMMsg setTargetCode(int code)
Description copied from interface: CMMsg
A combination bitmask, action type integer that describes information about how this event affects or is perceived by the target of the action.

Specified by:
setTargetCode in interface CMMsg
Parameters:
code - the new full bitmask/action type target event code
Returns:
this
See Also:
CMMsg.target(), CMMsg.targetMessage(), CMMsg.targetCode(), CMMsg.targetMajor(int), CMMsg.targetMinor(), CMMsg.MASK_MAGIC, CMMsg.TYP_CAST_SPELL

setOthersCode

public CMMsg setOthersCode(int code)
Description copied from interface: CMMsg
A combination bitmask, action type integer that describes information about how this event affects or is perceived by the others of the action. (Others are everyone not source, not target)

Specified by:
setOthersCode in interface CMMsg
Parameters:
code - the new full bitmask/action type others event code
Returns:
this
See Also:
CMMsg.othersMessage(), CMMsg.othersCode(), CMMsg.othersMajor(int), CMMsg.othersMinor(), CMMsg.MASK_MAGIC, CMMsg.TYP_CAST_SPELL

setSourceMessage

public CMMsg setSourceMessage(java.lang.String str)
Description copied from interface: CMMsg
Sets the string seen by the source of the event, and only by the source of the event.

Specified by:
setSourceMessage in interface CMMsg
Parameters:
str - the string to show to the source, or NULL
Returns:
this
See Also:
CMMsg.source(), CMMsg.sourceMessage(), CMMsg.sourceCode()

setTargetMessage

public CMMsg setTargetMessage(java.lang.String str)
Description copied from interface: CMMsg
Sets the string seen by the target of the event, and only by the target of the event.

Specified by:
setTargetMessage in interface CMMsg
Parameters:
str - the string to show to the target, or NULL
Returns:
this
See Also:
CMMsg.target(), CMMsg.targetMessage(), CMMsg.targetCode()

setOthersMessage

public CMMsg setOthersMessage(java.lang.String str)
Description copied from interface: CMMsg
Sets the string seen by the others of the event, and only by the others of the event. (Others are everyone not source, not target)

Specified by:
setOthersMessage in interface CMMsg
Parameters:
str - the string to show to the others, or NULL
Returns:
this
See Also:
CMMsg.othersMessage(), CMMsg.othersCode()

value

public int value()
Description copied from interface: CMMsg
Returns the arbitrary value integer associated with this event. Values tend to be defined in a event-action code specific way, so that it will mean nothing most of the time, and something different for each type of message. For custom messages therefore, it can be used for whatever one pleases, whereas for established codebase message types, you should understand its meaning before doing anything with it.

Specified by:
value in interface CMMsg
Returns:
the integer value of this event

setValue

public CMMsg setValue(int amount)
Description copied from interface: CMMsg
Sets an arbitrary integer value associated with this event. Values tend to be defined in a event-action code specific way, so that it will mean nothing most of the time, and something different for each type of message. For custom messages therefore, it can be used for whatever one pleases, whereas for established codebase message types, you should understand its meaning before doing anything with it.

Specified by:
setValue in interface CMMsg
Parameters:
amount - the integer value of this event
Returns:
this

trailerMsgs

public java.util.List<CMMsg> trailerMsgs()
Description copied from interface: CMMsg
Returns a List of other CMMsg events which are slated to be confirmed and executed AFTER this current message is handled. This is implemented by the Room object

Specified by:
trailerMsgs in interface CMMsg
Returns:
a List of CMMsg objects
See Also:
Room.send(MOB, CMMsg)

trailerRunnables

public java.util.List<java.lang.Runnable> trailerRunnables()
Description copied from interface: CMMsg
Returns a List of other Runnables which are slated to be and executed AFTER this current message is handled. This is implemented by the Room object

Specified by:
trailerRunnables in interface CMMsg
Returns:
a List of Runnable objects
See Also:
Room.send(MOB, CMMsg)

addTrailerMsg

public CMMsg addTrailerMsg(CMMsg msg)
Description copied from interface: CMMsg
Appends to the list of other CMMsg events which are slated to be confirmed and executed AFTER this current message is handled. This is implemented by the Room object

Specified by:
addTrailerMsg in interface CMMsg
Parameters:
msg - the CMMsg to append to this message.
Returns:
this
See Also:
Room.send(MOB, CMMsg)

addTrailerRunnable

public CMMsg addTrailerRunnable(java.lang.Runnable r)
Description copied from interface: CMMsg
Appends to the list of Runnable objects which are slated to be confirmed and executed AFTER this current message is handled. This is implemented by the Room object

Specified by:
addTrailerRunnable in interface CMMsg
Parameters:
r - the Runnable to append to this message.
Returns:
this
See Also:
Room.send(MOB, CMMsg)

modify

public CMMsg modify(MOB source,
                    Environmental target,
                    Environmental tool,
                    int newSourceCode,
                    java.lang.String sourceMessage,
                    int newTargetCode,
                    java.lang.String targetMessage,
                    int newOthersCode,
                    java.lang.String othersMessage)
Description copied from interface: CMMsg
Modifies one of more fields in this event.

Specified by:
modify in interface CMMsg
Parameters:
source - the new source of this event
target - the new target of this event
tool - the new tool for this event
newSourceCode - the new source code for this event
sourceMessage - the new source message for this event
newTargetCode - the new target code for this event
targetMessage - the new target message for this event
newOthersCode - the new others code for this event
othersMessage - the new others message for this event
Returns:
this
See Also:
CMMsg.source(), CMMsg.target(), CMMsg.sourceCode(), CMMsg.targetCode(), CMMsg.othersCode(), CMMsg.sourceMessage(), CMMsg.targetMessage(), CMMsg.othersMessage()

modify

public CMMsg modify(MOB source,
                    Environmental target,
                    Environmental tool,
                    int newSourceCode,
                    int newTargetCode,
                    int newOthersCode,
                    java.lang.String allMessage)
Description copied from interface: CMMsg
Modifies one of more fields in this event.

Specified by:
modify in interface CMMsg
Parameters:
source - the new source of this event
target - the new target of this event
tool - the new tool for this event
newSourceCode - the new source code for this event
newTargetCode - the new target code for this event
newOthersCode - the new others code for this event
allMessage - the new source, target, and others message of this event
Returns:
this
See Also:
CMMsg.source(), CMMsg.target(), CMMsg.sourceCode(), CMMsg.targetCode(), CMMsg.othersCode(), CMMsg.sourceMessage(), CMMsg.targetMessage(), CMMsg.othersMessage()

modify

public CMMsg modify(int newAllCode,
                    java.lang.String allMessage)
Description copied from interface: CMMsg
Modifies one of more fields in this event. Sets target and tool to NULL.

Specified by:
modify in interface CMMsg
Parameters:
newAllCode - the new source, target, and others code of this event
allMessage - the new source, target, and others message of this event
Returns:
this
See Also:
CMMsg.source(), CMMsg.target(), CMMsg.sourceCode(), CMMsg.targetCode(), CMMsg.othersCode(), CMMsg.sourceMessage(), CMMsg.targetMessage(), CMMsg.othersMessage()

modify

public CMMsg modify(int newSourceCode,
                    java.lang.String sourceMessage,
                    int newTargetCode,
                    java.lang.String targetMessage,
                    int newOthersCode,
                    java.lang.String othersMessage)
Description copied from interface: CMMsg
Modifies one of more fields in this event.

Specified by:
modify in interface CMMsg
Parameters:
newSourceCode - the new source code for this event
sourceMessage - the new source message for this event
newTargetCode - the new target code for this event
targetMessage - the new target message for this event
newOthersCode - the new others code for this event
othersMessage - the new others message for this event
Returns:
this
See Also:
CMMsg.source(), CMMsg.target(), CMMsg.sourceCode(), CMMsg.targetCode(), CMMsg.othersCode(), CMMsg.sourceMessage(), CMMsg.targetMessage(), CMMsg.othersMessage()

source

public final MOB source()
Description copied from interface: CMMsg
Returns the source of this event, a MOB object

Specified by:
source in interface CMMsg
Returns:
the source of this event
See Also:
CMMsg.setSource(MOB), MOB

setSource

public final CMMsg setSource(MOB mob)
Description copied from interface: CMMsg
Sets the source of this event, a MOB object

Specified by:
setSource in interface CMMsg
Parameters:
mob - the new source of this event
Returns:
this
See Also:
CMMsg.source(), MOB

target

public final Environmental target()
Description copied from interface: CMMsg
Returns the target of this event, an Environmental object

Specified by:
target in interface CMMsg
Returns:
the target of this event
See Also:
CMMsg.setTarget(Environmental), Environmental

setTarget

public final CMMsg setTarget(Environmental E)
Description copied from interface: CMMsg
Sets the target of this event, an Environmental object

Specified by:
setTarget in interface CMMsg
Parameters:
E - the new target of this event
Returns:
this
See Also:
CMMsg.target(), Environmental

tool

public final Environmental tool()
Description copied from interface: CMMsg
Returns the means, item, portal, or otherwise tool that helps the source affect the event upon the target.

Specified by:
tool in interface CMMsg
Returns:
the tool of this event
See Also:
Environmental, CMMsg.setTool(Environmental)

setTool

public final CMMsg setTool(Environmental E)
Description copied from interface: CMMsg
Sets the means, item, portal, or otherwise tool that helps the source affect the event upon the target.

Specified by:
setTool in interface CMMsg
Parameters:
E - the new tool of this event
Returns:
this
See Also:
Environmental, CMMsg.tool()

targetMajor

public final int targetMajor()
Description copied from interface: CMMsg
Returns high order bitmask for the target code

Specified by:
targetMajor in interface CMMsg
Returns:
high order bitmask for the target code
See Also:
CMMsg.targetCode(), CMMsg.targetMinor(), CMMsg.MASK_MAGIC

sourceMajor

public final int sourceMajor()
Description copied from interface: CMMsg
Returns high order bitmask for the source code

Specified by:
sourceMajor in interface CMMsg
Returns:
high order bitmask for the source code
See Also:
CMMsg.sourceCode(), CMMsg.sourceMinor(), CMMsg.MASK_MAGIC

othersMajor

public final int othersMajor()
Description copied from interface: CMMsg
Returns high order bitmask for the others code (Others are everyone not source, not target)

Specified by:
othersMajor in interface CMMsg
Returns:
high order bitmask for the others code
See Also:
CMMsg.othersCode(), CMMsg.othersMinor(), CMMsg.MASK_MAGIC

targetMajor

public final boolean targetMajor(int bitMask)
Description copied from interface: CMMsg
Returns whether high order bitmask for the target code is set

Specified by:
targetMajor in interface CMMsg
Parameters:
bitMask - the bitmask to check for
Returns:
true if high order bitmask for the target code is set
See Also:
CMMsg.targetCode(), CMMsg.targetMinor(), CMMsg.MASK_MAGIC

targetMinor

public final int targetMinor()
Description copied from interface: CMMsg
Returns low order action type integer for the target code

Specified by:
targetMinor in interface CMMsg
Returns:
low order action type integer for the target code
See Also:
CMMsg.targetCode(), CMMsg.targetMajor(int), CMMsg.TYP_CAST_SPELL

targetCode

public final int targetCode()
Description copied from interface: CMMsg
A combination bitmask, action type integer that describes information about how this event affects or is perceived by the target of the action.

Specified by:
targetCode in interface CMMsg
Returns:
the combination bitmask/action type integer for target of event
See Also:
CMMsg.target(), CMMsg.targetMessage(), CMMsg.targetMajor(int), CMMsg.targetMinor(), CMMsg.MASK_MAGIC, CMMsg.TYP_CAST_SPELL, CMMsg.setTargetCode(int)

targetMessage

public final java.lang.String targetMessage()
Description copied from interface: CMMsg
Returns the string seen by the target of the event, and only by the target of the event.

Specified by:
targetMessage in interface CMMsg
Returns:
a string to show to the target
See Also:
CMMsg.target(), CMMsg.setTargetMessage(String), CMMsg.targetCode()

sourceCode

public final int sourceCode()
Description copied from interface: CMMsg
A combination bitmask, action type integer that describes information about how this event affects or is perceived by the source of the action.

Specified by:
sourceCode in interface CMMsg
Returns:
the combination bitmask/action type integer for source of event
See Also:
CMMsg.source(), CMMsg.sourceMessage(), CMMsg.sourceMajor(int), CMMsg.sourceMinor(), CMMsg.MASK_MAGIC, CMMsg.TYP_CAST_SPELL, CMMsg.setSourceCode(int)

sourceMajor

public final boolean sourceMajor(int bitMask)
Description copied from interface: CMMsg
Returns whether high order bitmask for the source code is set

Specified by:
sourceMajor in interface CMMsg
Parameters:
bitMask - the bitmask to check for
Returns:
true if high order bitmask for the source code is set
See Also:
CMMsg.sourceCode(), CMMsg.sourceMinor(), CMMsg.MASK_MAGIC

sourceMinor

public final int sourceMinor()
Description copied from interface: CMMsg
Returns low order action type integer for the target code

Specified by:
sourceMinor in interface CMMsg
Returns:
low order action type integer for the target code
See Also:
CMMsg.targetCode(), CMMsg.targetMajor(int), CMMsg.TYP_CAST_SPELL

sourceMessage

public final java.lang.String sourceMessage()
Description copied from interface: CMMsg
Returns the string seen by the source of the event, and only by the source of the event.

Specified by:
sourceMessage in interface CMMsg
Returns:
a string to show to the source
See Also:
CMMsg.source(), CMMsg.setSourceMessage(String), CMMsg.sourceCode()

othersMajor

public final boolean othersMajor(int bitMask)
Description copied from interface: CMMsg
Returns whether high order bitmask for the others code is set (Others are everyone not source, not target)

Specified by:
othersMajor in interface CMMsg
Parameters:
bitMask - the bitmask to check for
Returns:
true if high order bitmask for the others code is set
See Also:
CMMsg.othersCode(), CMMsg.othersMinor(), CMMsg.MASK_MAGIC

othersMinor

public final int othersMinor()
Description copied from interface: CMMsg
Returns low order action type integer for the others code (Others are everyone not source, not target)

Specified by:
othersMinor in interface CMMsg
Returns:
low order action type integer for the others code
See Also:
CMMsg.othersCode(), CMMsg.othersMajor(int), CMMsg.TYP_CAST_SPELL

othersCode

public final int othersCode()
Description copied from interface: CMMsg
A combination bitmask, action type integer that describes information about how this event affects or is perceived by the others of the action. (Others are everyone not source, not target)

Specified by:
othersCode in interface CMMsg
Returns:
the combination bitmask/action type integer for others of event
See Also:
CMMsg.othersMessage(), CMMsg.othersMajor(int), CMMsg.othersMinor(), CMMsg.MASK_MAGIC, CMMsg.TYP_CAST_SPELL, CMMsg.setOthersCode(int)

othersMessage

public final java.lang.String othersMessage()
Description copied from interface: CMMsg
Returns the string seen by the others of the event, and only by the others of the event. (Others are everyone not source, not target)

Specified by:
othersMessage in interface CMMsg
Returns:
a string to show to the others
See Also:
CMMsg.setOthersMessage(String), CMMsg.othersCode()

amITarget

public final boolean amITarget(Environmental thisOne)
Description copied from interface: CMMsg
Returns whether the given Environmental object is, in fact, the target of this message.

Specified by:
amITarget in interface CMMsg
Parameters:
thisOne - the Environmental to inspect, may not be null
Returns:
whether the given thisOne is the target of this message
See Also:
CMMsg.target(), Environmental

amISource

public final boolean amISource(MOB thisOne)
Description copied from interface: CMMsg
Returns whether the given Environmental object is, in fact, the source of this message.

Specified by:
amISource in interface CMMsg
Parameters:
thisOne - the Environmental to inspect, may not be null
Returns:
whether the given thisOne is the source of this message
See Also:
CMMsg.source(), Environmental

isTarget

public final boolean isTarget(Environmental E)
Description copied from interface: CMMsg
Returns whether the given Environmental object is, in fact, the target of this message.

Specified by:
isTarget in interface CMMsg
Parameters:
E - the Environmental to inspect, may not be null
Returns:
whether the given E is the target of this message
See Also:
CMMsg.target(), Environmental

isTarget

public final boolean isTarget(int codeOrMask)
Description copied from interface: CMMsg
Returns whether the given code or mask is either the minor code or a part of the major code of the targetCode

Specified by:
isTarget in interface CMMsg
Parameters:
codeOrMask - the target action code or target major mask to check
Returns:
whether there is a match
See Also:
CMMsg.targetCode()

isTarget

public final boolean isTarget(java.lang.String codeOrMaskDesc)
Description copied from interface: CMMsg
Returns whether the given code or mask string matches the minor code or a part of the major code of the targetCode.

Specified by:
isTarget in interface CMMsg
Parameters:
codeOrMaskDesc - the target action code string, or mask string
Returns:
whether there is a match
See Also:
CMMsg.TYPE_DESCS, CMMsg.MASK_DESCS, CMMsg.targetCode()

isTargetMajor

public final boolean isTargetMajor(java.lang.String codeOrMaskDesc)
Description copied from interface: CMMsg
Returns whether the given code or mask string matches a part of the major code of the targetCode.

Specified by:
isTargetMajor in interface CMMsg
Parameters:
codeOrMaskDesc - the target action code string, or mask string
Returns:
whether there is a match
See Also:
CMMsg.TYPE_DESCS, CMMsg.MASK_DESCS, CMMsg.targetCode()

isTargetMinor

public final boolean isTargetMinor(java.lang.String codeOrMaskDesc)
Description copied from interface: CMMsg
Returns whether the given code or mask string matches the minor sourceCode

Specified by:
isTargetMinor in interface CMMsg
Parameters:
codeOrMaskDesc - the target action code string, or mask string
Returns:
whether there is a match
See Also:
CMMsg.TYPE_DESCS, CMMsg.MASK_DESCS, CMMsg.targetCode()

isSource

public final boolean isSource(Environmental E)
Description copied from interface: CMMsg
Returns whether the given Environmental object is, in fact, the source of this message.

Specified by:
isSource in interface CMMsg
Parameters:
E - the Environmental to inspect, may not be null
Returns:
whether the given E is the source of this message
See Also:
CMMsg.source(), Environmental

isSource

public final boolean isSource(int codeOrMask)
Description copied from interface: CMMsg
Returns whether the given code or mask is either the minor code or a part of the major code of the sourceCode

Specified by:
isSource in interface CMMsg
Parameters:
codeOrMask - the source action code or source major mask to check
Returns:
whether there is a match
See Also:
CMMsg.sourceCode()

isSource

public final boolean isSource(java.lang.String codeOrMaskDesc)
Description copied from interface: CMMsg
Returns whether the given code or mask string matches the minor code or a part of the major code of the sourceCode.

Specified by:
isSource in interface CMMsg
Parameters:
codeOrMaskDesc - the source action code string, or mask string
Returns:
whether there is a match
See Also:
CMMsg.TYPE_DESCS, CMMsg.MASK_DESCS, CMMsg.sourceCode()

isSourceMajor

public final boolean isSourceMajor(java.lang.String codeOrMaskDesc)
Description copied from interface: CMMsg
Returns whether the given code or mask string matches a part of the major code of the sourceCode.

Specified by:
isSourceMajor in interface CMMsg
Parameters:
codeOrMaskDesc - the source action code string, or mask string
Returns:
whether there is a match
See Also:
CMMsg.TYPE_DESCS, CMMsg.MASK_DESCS, CMMsg.sourceCode()

isSourceMinor

public final boolean isSourceMinor(java.lang.String codeOrMaskDesc)
Description copied from interface: CMMsg
Returns whether the given code or mask string matches the minor sourceCode

Specified by:
isSourceMinor in interface CMMsg
Parameters:
codeOrMaskDesc - the source action code string, or mask string
Returns:
whether there is a match
See Also:
CMMsg.TYPE_DESCS, CMMsg.MASK_DESCS, CMMsg.sourceCode()

isOthers

public final boolean isOthers(Environmental E)
Description copied from interface: CMMsg
Returns whether the given Environmental object is neither the source nor the target of this message.

Specified by:
isOthers in interface CMMsg
Parameters:
E - the Environmental to inspect, may not be null
Returns:
whether the given E is neither the source nor target of this message
See Also:
Environmental, CMMsg.source(), CMMsg.target()

isOthers

public final boolean isOthers(int codeOrMask)
Description copied from interface: CMMsg
Returns whether the given code or mask is either the minor code or a part of the major code of the othersCode

Specified by:
isOthers in interface CMMsg
Parameters:
codeOrMask - the others action code or others major mask to check
Returns:
whether there is a match
See Also:
CMMsg.othersCode()

isOthers

public final boolean isOthers(java.lang.String codeOrMaskDesc)
Description copied from interface: CMMsg
Returns whether the given code or mask string matches the minor code or a part of the major code of the othersCode. (Others are everyone not source, not target)

Specified by:
isOthers in interface CMMsg
Parameters:
codeOrMaskDesc - the others action code string, or mask string
Returns:
whether there is a match
See Also:
CMMsg.TYPE_DESCS, CMMsg.MASK_DESCS, CMMsg.othersCode()

isOthersMajor

public final boolean isOthersMajor(java.lang.String codeOrMaskDesc)
Description copied from interface: CMMsg
Returns whether the given code or mask string matches a part of the major code of the othersCode. (Others are everyone not source, not target)

Specified by:
isOthersMajor in interface CMMsg
Parameters:
codeOrMaskDesc - the others action code string, or mask string
Returns:
whether there is a match
See Also:
CMMsg.TYPE_DESCS, CMMsg.MASK_DESCS, CMMsg.othersCode()

isOthersMinor

public final boolean isOthersMinor(java.lang.String codeOrMaskDesc)
Description copied from interface: CMMsg
Returns whether the given code or mask string matches the minor sourceCode (Others are everyone not source, not target)

Specified by:
isOthersMinor in interface CMMsg
Parameters:
codeOrMaskDesc - the others action code string, or mask string
Returns:
whether there is a match
See Also:
CMMsg.TYPE_DESCS, CMMsg.MASK_DESCS, CMMsg.othersCode()

matches

protected static final boolean matches(int major,
                                       int minor,
                                       int code)

matches

protected static final boolean matches(int major,
                                       int minor,
                                       java.lang.String code2)

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toFlatString

public java.lang.String toFlatString()
Description copied from interface: CMMsg
Serializes this message as well as it reasonably can. It skips any trailer messages and runnables.

Specified by:
toFlatString in interface CMMsg
Returns:
the serialized message
See Also:
CMMsg.parseFlatString(String)

parseFlatObject

protected CMObject parseFlatObject(java.lang.String part,
                                   CMClass.CMObjectType preferClass)

parseFlatString

public void parseFlatString(java.lang.String flat)
Description copied from interface: CMMsg
Unserializes this message as well as it reasonably can. It skips any trailer messages and runnables.

Specified by:
parseFlatString in interface CMMsg
Parameters:
flat - the serialized message
See Also:
CMMsg.toFlatString()

sameAs

public boolean sameAs(CMMsg E)
Description copied from interface: CMMsg
Whether this object instance is functionally identical to the object passed in.

Specified by:
sameAs in interface CMMsg
Parameters:
E - the object to compare this one to
Returns:
whether this object is the same as the one passed in