|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.freecol.common.networking.DOMMessage
net.sf.freecol.common.networking.ChatMessage
public class ChatMessage
The message that contains a chat string.
| Field Summary | |
|---|---|
private java.lang.String |
message
The text of the message. |
private Player |
player
The sending player. |
private boolean |
privateChat
Whether this is a private message or not. |
private java.lang.String |
sender
The ID of the sender player. |
| Fields inherited from class net.sf.freecol.common.networking.DOMMessage |
|---|
document, logger |
| 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.DOMMessage |
|---|
clientError, createError, createError, createNewDocument, createNewRootElement, getAttribute, getChildElement, getDocument, getFreeColProtocolVersion, getType, hasAttribute, insertAsRoot, isType, setAttribute, setAttribute, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private Player player
private java.lang.String sender
private java.lang.String message
private boolean privateChat
| 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 DOMMessagepublic static java.lang.String getXMLElementTagName()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||