|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.freecol.common.networking.Message
net.sf.freecol.common.networking.ChatMessage
public class ChatMessage
The message that contains a chat string.
Constructor Summary | |
---|---|
ChatMessage(Game game,
org.w3c.dom.Element element)
Create a new ChatMessage from a
supplied element. |
|
ChatMessage(Player player,
java.lang.String message,
boolean privateChat)
Create a new ChatMessage with the
supplied message. |
Method Summary | |
---|---|
java.lang.String |
getMessage()
What is the text of this ChatMessage? |
Player |
getPlayer()
Who sent this ChatMessage? |
static java.lang.String |
getXMLElementTagName()
The tag name of the root element representing this object. |
org.w3c.dom.Element |
handle(FreeColServer server,
Connection connection)
Handle a "chat"-message. |
boolean |
isPrivate()
Is this ChatMessage private? |
org.w3c.dom.Element |
toXMLElement()
Convert this ChatMessage to XML. |
Methods inherited from class net.sf.freecol.common.networking.Message |
---|
clientError, createError, createError, createNewDocument, createNewRootElement, getAttribute, getChildElement, getDocument, getFreeColProtocolVersion, getType, hasAttribute, insertAsRoot, isType, setAttribute, setAttribute, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ChatMessage(Player player, java.lang.String message, boolean privateChat)
ChatMessage
with the
supplied message.
player
- The player that is sending the message.message
- The text of the message to send.privateChat
- Whether this message is private.public ChatMessage(Game game, org.w3c.dom.Element element)
ChatMessage
from a
supplied element.
game
- The Game
this message belongs to.element
- The Element
to use to create the message.
java.lang.IllegalStateException
- if there is problem with the senderID.Method Detail |
---|
public Player getPlayer()
public java.lang.String getMessage()
public boolean isPrivate()
public org.w3c.dom.Element handle(FreeColServer server, Connection connection)
server
- The FreeColServer
that handles the message.connection
- The Connection
message was received on.
public org.w3c.dom.Element toXMLElement()
toXMLElement
in class Message
public static java.lang.String getXMLElementTagName()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |