|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jogre.common.comm.CommBaseMessage
This is a base message which all communication objects should extend except the GameList and its children data classes. This includes a the username of the person who sent it and the status of the communication. The status codes should be defined in the sub class as a integer constant.
Field Summary | |
protected int |
layer
Layer that message belongs to. |
protected int |
status
Integer status of this comm message. |
protected String |
username
Username of person who sent this message. |
static String |
XML_ATT_LAYER
Type of message is used to determine which layer the message is for. |
Constructor Summary | |
protected |
CommBaseMessage()
Constructor with no parameters (no status). |
protected |
CommBaseMessage(int status)
Constructor which takes a username and a status. |
protected |
CommBaseMessage(XMLElement message)
Constructor which parses the XMLElement into class fields. |
Method Summary | |
XMLElement |
flatten(String name)
Create a generic (nameless) XMLElement which sub classes can use. |
int |
getStatus()
Return the status. |
String |
getUsername()
Return the username. |
void |
setUsername(String username)
Sets the username of the communication object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jogre.common.comm.ITransmittable |
flatten |
Field Detail |
protected String username
protected int status
protected int layer
public static final String XML_ATT_LAYER
Constructor Detail |
protected CommBaseMessage()
protected CommBaseMessage(int status)
status
- A statusprotected CommBaseMessage(XMLElement message)
message
- Element to parse.Method Detail |
public void setUsername(String username)
username
- Username of sender communication object.public String getUsername()
public int getStatus()
public XMLElement flatten(String name)
name
- Name of the XML element.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |