wtanaka.praya.obj
Class Message

java.lang.Object
  |
  +--wtanaka.praya.obj.Obj
        |
        +--wtanaka.praya.obj.Message
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
BnetChannelMessage, BnetEmoteMessage, BnetInfoMessage, BnetJoinMessage, BnetLeaveMessage, BnetModeratorMessage, BnetTalkMessage, BnetUserMessage, BnetWhisperFromMessage, CalendarMessage, ErrorMessage, GFXMessage, InfoMessage, IRCMessage, LoggedOnElsewhereMessage, MailMessage, MsnMessage, MultiDefinition, OkMessage, PrayaMessage, Puff, RecipientInfoMessage, SelfMessage, ShowListMessage, TextDefinition, YahooLoginMessage, YahooLogoutMessage, YahooMessage, YahooStatusMessage, ZhongWenMessage

public abstract class Message
extends Obj
implements java.io.Serializable

This is the superclass for all messages. Every single message in praya should extend from this class.

Return to Sourceforge or the Praya Homepage

Version:
$Name: $ $Date: 2002/07/14 05:06:50 $
Author:
$Author: wtanaka $
See Also:
Serialized Form

Field Summary
protected  Protocol generatedBy
           
private  int score
           
 
Fields inherited from class wtanaka.praya.obj.Obj
CONTENTS, date, DATE, FROM, privThread, REVCONTENTS, REVDATE, REVFROM, REVSCORE, REVSUBJECT, SCORE, secretObject, SUBJECT
 
Constructor Summary
Message(Protocol generatedBy)
           
 
Method Summary
 void changeScore(int delta)
           
 java.lang.String convertStringToHtml(java.lang.String str)
           
 int getScore()
           
 Protocol getSourceProtocol()
          gets the protocol that created this message
 boolean isSelfMessage()
          Is this message is an outgoing message generated by the person viewing it? The return value from this method acts acts as a tag on certain kinds of messages.
 boolean isStateChangeMessage()
          Does this message represent someone logging in or out, or joining or leaving a conversation, channel or otherwise changing status.
 boolean lessThan(Obj other, int key)
           
 java.lang.String renderAsHTML()
          Prototype code for praya feature request 414224: http://sf.net/tracker/?func=detail&aid=414224&group_id=2302&atid=352302
protected  java.lang.String renderAsHTML(java.lang.String iconURL)
          Prototype code for praya feature request 414224: http://sf.net/tracker/?func=detail&aid=414224&group_id=2302&atid=352302
 java.lang.String renderAsString()
           
 Recipient replyRecipient()
          Gets the recipient to whom replies to this message will be sent, if applicable.
 void setZombie()
          If the protocol that generated this message is no longer valid, this method is called, removing the refernce to the dead protocol from the message.
 java.lang.String toString()
           
 
Methods inherited from class wtanaka.praya.obj.Obj
getContents, getFrom, getSubject, getTimeStamp, isPrivileged, setPrivilegedThread, setSecretObject, setTimeStamp
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

generatedBy

protected Protocol generatedBy

score

private int score
Constructor Detail

Message

public Message(Protocol generatedBy)
Method Detail

getSourceProtocol

public Protocol getSourceProtocol()
gets the protocol that created this message
Returns:
the protocol which created this message

setZombie

public void setZombie()
If the protocol that generated this message is no longer valid, this method is called, removing the refernce to the dead protocol from the message.

renderAsString

public java.lang.String renderAsString()

convertStringToHtml

public java.lang.String convertStringToHtml(java.lang.String str)

renderAsHTML

public java.lang.String renderAsHTML()
Prototype code for praya feature request 414224: http://sf.net/tracker/?func=detail&aid=414224&group_id=2302&atid=352302

renderAsHTML

protected java.lang.String renderAsHTML(java.lang.String iconURL)
Prototype code for praya feature request 414224: http://sf.net/tracker/?func=detail&aid=414224&group_id=2302&atid=352302

lessThan

public boolean lessThan(Obj other,
                        int key)
Overrides:
lessThan in class Obj

getScore

public int getScore()

changeScore

public void changeScore(int delta)

replyRecipient

public Recipient replyRecipient()
Gets the recipient to whom replies to this message will be sent, if applicable.
Returns:
the recipient object for replies to this message. If there is no relevant recipient (e.g. this a logout message) returns null.

isSelfMessage

public boolean isSelfMessage()
Is this message is an outgoing message generated by the person viewing it? The return value from this method acts acts as a tag on certain kinds of messages. If a message returns true from this method, that means that it was sent by the client that contains this reference. Likewise, if a protocol pushes a message itself, one that wasn't received from another source, that message must return true from this method. This makes it easy for bots to not talk to themselves.
Returns:
true if this is a self generated message, false otherwise

isStateChangeMessage

public boolean isStateChangeMessage()
Does this message represent someone logging in or out, or joining or leaving a conversation, channel or otherwise changing status.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object