org.jogre.comm
Class CommTableMessage

java.lang.Object
  |
  +--org.jogre.comm.CommSimpleMessage
        |
        +--org.jogre.comm.CommTableMessage
All Implemented Interfaces:
ITransmittable
Direct Known Subclasses:
CommGameOver, CommInvite, CommTableAction

public abstract class CommTableMessage
extends CommSimpleMessage

Abstract base class for table messages. This class is used for creating communication objects between games e.g. CommExecuteChessMove. Fields which are most commonly used include username, status and table number.

Version:
Alpha 0.1
Author:
Bob Marks

Field Summary
protected  boolean isPublic
           
static int NO_TABLE
          No table being used in the message.
protected  int tableNum
           
 
Fields inherited from class org.jogre.comm.CommSimpleMessage
status, username
 
Constructor Summary
protected CommTableMessage()
          Empty constructor (used for reading a flat string)
protected CommTableMessage(int tableNum)
          Create a communcation table object with just a table number.
protected CommTableMessage(String username, int tableNum)
          This constructor creates a table message where there is NO status and doesn't worry if a table is private/public.
protected CommTableMessage(String username, int tableNum, int status)
          Create a table message with a username, table number and a status.
protected CommTableMessage(String username, int status, int tableNum, boolean isPublic)
          Create a new table message with a username, status, tableNum and a boolean to show if a table is public or private.
 
Method Summary
 int getTableNum()
          Return the table number for this table.
 boolean isPublic()
          Return true if this table is public.
 
Methods inherited from class org.jogre.comm.CommSimpleMessage
getStatus, getUsername
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jogre.comm.ITransmittable
flatten
 

Field Detail

NO_TABLE

public static final int NO_TABLE
No table being used in the message.

tableNum

protected int tableNum

isPublic

protected boolean isPublic
Constructor Detail

CommTableMessage

protected CommTableMessage()
Empty constructor (used for reading a flat string)

CommTableMessage

protected CommTableMessage(int tableNum)
Create a communcation table object with just a table number.
Parameters:
tableNum -  

CommTableMessage

protected CommTableMessage(String username,
                           int tableNum)
This constructor creates a table message where there is NO status and doesn't worry if a table is private/public.
Parameters:
username -  
tableNum -  

CommTableMessage

protected CommTableMessage(String username,
                           int tableNum,
                           int status)
Create a table message with a username, table number and a status.
Parameters:
username -  
tableNum -  
status -  

CommTableMessage

protected CommTableMessage(String username,
                           int status,
                           int tableNum,
                           boolean isPublic)
Create a new table message with a username, status, tableNum and a boolean to show if a table is public or private.
Parameters:
username - User who send the CommInvite object.
status - Status of the message i.e. request, accept & decline.
tableNum - Table number of the message.
isPublic - Boolean to specifie if the table is public or not.
Method Detail

getTableNum

public int getTableNum()
Return the table number for this table.
Returns:
 

isPublic

public boolean isPublic()
Return true if this table is public.
Returns: