org.jogre.client
Class TableConnectionThread

java.lang.Object
  extended byorg.jogre.client.TableConnectionThread

public class TableConnectionThread
extends Object

Convience class for sending message from a table client frame in JOGRE.

This class also has links to several methods in the ClientConnectionThread class through delegation.

This class holds a link to the ClientConnectionThread (as there should only be one instance per client) and a tableNum which it appends to messages automatically when a send method is called.

Version:
Alpha 0.2.3
Author:
Bob Marks

Constructor Summary
TableConnectionThread(ClientConnectionThread conn, int tableNum)
          Constructor which takes a ClientConnectionThread and a table number.
 
Method Summary
 ClientConnectionThread getClientConnectionThread()
          Return the client connection thread which is a field.
 Game getGame()
          Return the game object on this connection.
 Socket getSocket()
          Return the socket as a field.
 Table getTable()
          Return the table associated with this table connection class.
 TableList getTableList()
          Delegate method for returning the table list.
 int getTableNum()
          Return the table number.
 UserList getUserList()
          Delegate method for returning the user list.
 String getUsername()
          Delegate method for returning a username;
 boolean isOwnerOfTable()
          Return thue if this user is the owner of the table.
 void send(CommGameMessage message)
          Send a game message.
 void send(CommTableMessage message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableConnectionThread

public TableConnectionThread(ClientConnectionThread conn,
                             int tableNum)
Constructor which takes a ClientConnectionThread and a table number.

Parameters:
conn - Connection to server.
tableNum - Current table number.
Method Detail

send

public void send(CommTableMessage message)
Parameters:
message -

getTableNum

public int getTableNum()
Return the table number.

Returns:
Table number

getTable

public Table getTable()
Return the table associated with this table connection class.


getGame

public Game getGame()
Return the game object on this connection.

Returns:

send

public void send(CommGameMessage message)
Send a game message.

Parameters:
message - Game message.

getUsername

public String getUsername()
Delegate method for returning a username;

Returns:
Username.

getTableList

public TableList getTableList()
Delegate method for returning the table list.

Returns:
List of tables.

getUserList

public UserList getUserList()
Delegate method for returning the user list.

Returns:
List of users.

isOwnerOfTable

public boolean isOwnerOfTable()
Return thue if this user is the owner of the table.

Returns:

getClientConnectionThread

public ClientConnectionThread getClientConnectionThread()
Return the client connection thread which is a field.

Returns:
Current connection to server.

getSocket

public Socket getSocket()
Return the socket as a field.

Returns: