org.jogre.common.comm
Class CommControllerProperty

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

public class CommControllerProperty
extends CommTableMessage

Communication object to send a key/value property from a client to server or vice versa. Used in the JogreController to simplify the sending and receiving of data.

Version:
Alpha 0.2.1
Author:
Bob Marks

Field Summary
static int TYPE_INT
          Type is an integer.
static int TYPE_INT_ARRAY
          Type is a point.
static int TYPE_INT_TWO
          Type is two integer e.g.
static int TYPE_STRING
          Type is a String.
 
Fields inherited from class org.jogre.common.comm.CommTableMessage
NO_TABLE, omitSender, tableNum, XML_ATT_TABLE_NUM
 
Fields inherited from class org.jogre.common.comm.CommGameMessage
gameID, LAYER, usernameTo, XML_ATT_GAME_ID
 
Fields inherited from class org.jogre.common.comm.CommBaseMessage
layer, status, username, XML_ATT_LAYER
 
Constructor Summary
CommControllerProperty(int status, String key, String value)
          Constructor which takes a username, status, table number and a value.
CommControllerProperty(XMLElement message)
          Constructor which reads the game over object from a String.
 
Method Summary
 XMLElement flatten()
          Flatten communciation object.
 String getKey()
          Return the key.
 String getValue()
          Return the value.
 
Methods inherited from class org.jogre.common.comm.CommTableMessage
flatten, getTableNum, isOmittingSender, setTableNum
 
Methods inherited from class org.jogre.common.comm.CommGameMessage
getGameID, getUsernameTo, isUsernameToSet, setGameID
 
Methods inherited from class org.jogre.common.comm.CommBaseMessage
getStatus, getUsername, setUsername
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_STRING

public static final int TYPE_STRING
Type is a String.

See Also:
Constant Field Values

TYPE_INT

public static final int TYPE_INT
Type is an integer.

See Also:
Constant Field Values

TYPE_INT_TWO

public static final int TYPE_INT_TWO
Type is two integer e.g. co-ordinate for example.

See Also:
Constant Field Values

TYPE_INT_ARRAY

public static final int TYPE_INT_ARRAY
Type is a point.

See Also:
Constant Field Values
Constructor Detail

CommControllerProperty

public CommControllerProperty(int status,
                              String key,
                              String value)
Constructor which takes a username, status, table number and a value.

Parameters:
status - Type of message e.g. TYPE_STRING, TYPE_INT etc.
key - Key
value - Value

CommControllerProperty

public CommControllerProperty(XMLElement message)
                       throws TransmissionException
Constructor which reads the game over object from a String.

Parameters:
message - XML element version of object.
Throws:
TransmissionException - Thrown if problem in transmission
Method Detail

getKey

public String getKey()
Return the key.

Returns:
Controller key.

getValue

public String getValue()
Return the value.

Returns:
Controller property.

flatten

public XMLElement flatten()
Flatten communciation object.

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