org.jogre.common.comm
Class CommControllerObject

java.lang.Object
  extended byorg.jogre.common.comm.CommGameMessage
      extended byorg.jogre.common.comm.CommTableMessage
          extended byorg.jogre.common.comm.CommControllerObject
All Implemented Interfaces:
ITransmittable

public class CommControllerObject
extends CommTableMessage

Communication object which will send a XMLElement as a child from a client to server (or or vice versa). Used in the JogreController to simplify the sending and receiving of more complex data.

Version:
Alpha 0.2.3
Author:
Bob Marks

Field Summary
protected  XMLElement data
          XMLElement of data.
 
Fields inherited from class org.jogre.common.comm.CommTableMessage
NO_TABLE, tableNum, XML_ATT_TABLE_NUM
 
Fields inherited from class org.jogre.common.comm.CommGameMessage
status, username, usernameTo, XML_ATT_STATUS, XML_ATT_USERNAME, XML_ATT_USERNAME_TO
 
Constructor Summary
CommControllerObject()
          Empty Constructor.
CommControllerObject(XMLElement message)
          Constructor which takes an XMLElement.
 
Method Summary
 XMLElement flatten()
          This method flattens an ITransmittable object into a XMLElement which can be transmitted.
 XMLElement getData()
          Return the data back to the user.
 void setData(XMLElement data)
          Set data.
 
Methods inherited from class org.jogre.common.comm.CommTableMessage
flatten, getTableNum, setTableNum
 
Methods inherited from class org.jogre.common.comm.CommGameMessage
getStatus, getUsername, getUsernameTo, isUsernameSet, isUsernameToSet, setUsername, setUsernameTo, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

data

protected XMLElement data
XMLElement of data.

Constructor Detail

CommControllerObject

public CommControllerObject()
Empty Constructor. This class must use the setData method (this constructor cannot take an XMLElement as this would conflict with the parse constructor).


CommControllerObject

public CommControllerObject(XMLElement message)
Constructor which takes an XMLElement.

Parameters:
message -
Method Detail

setData

public void setData(XMLElement data)
Set data.

Parameters:
data -

getData

public XMLElement getData()
Return the data back to the user.

Returns:
Data as XML object.

flatten

public XMLElement flatten()
Description copied from interface: ITransmittable
This method flattens an ITransmittable object into a XMLElement which can be transmitted. The object can then be recreated again using a single XMLElement parameter constructor.

Returns:
XML version of the state of an object which can be constructed again.
See Also:
ITransmittable.flatten()