|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
org.jogre.common.TableList
Contains a HashMap of all the Table objects currently in play. This class also implements the ITransmittable interface so this object can be transferred across the network.
Field Summary | |
protected HashMap |
tablelist
HashMap containing a number of Table objects. |
Constructor Summary | |
TableList()
Default constructor which sets up a brand new TableList object with no Tables in its HashMap. |
|
TableList(XMLElement message)
Constructor which recreates a Table object using a String from the ITransmittable.flatten() method from another TableList object. |
Method Summary | |
int |
addTable(String username,
boolean isPublic,
JogrePropertyHash properties)
Add a new Table object to the HashMap. |
Integer |
computeNewTableNum()
Computes a new table number. |
XMLElement |
flatten()
Flatten the current list of logged on users. |
int |
getNumOfTablesUserOwns(String username)
Return the number of tables that a specified user has created i.e. |
Table |
getTable(int tableNum)
Return a Table object from a specified table number. |
int[] |
getTableNumsForUser(String username)
Return a list of table numbers of a user. |
int[] |
getTablesNumbers()
Returns a list of all the table numbers. |
void |
refreshObservers()
Refresh observers - calls the setChanged() and notifyObservers () methods in the Observable class. |
void |
removePlayer(int tableNum,
String player)
Remove a player from a table. |
void |
removeTable(int tableNum)
Remove table from the list. |
void |
removeUserFromTables(String player)
Remove a user from tables. |
int |
size()
Return the size of the table list. |
void |
updateTable(int tableNum,
Table table)
Update a table in the table list. |
Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected HashMap tablelist
Constructor Detail |
public TableList()
public TableList(XMLElement message) throws TransmissionException
message
- String representation of a TableList object
TransmissionException
Method Detail |
public int addTable(String username, boolean isPublic, JogrePropertyHash properties)
username
- Username of owner of this table.isPublic
- True / false if public / private table.
public void removeTable(int tableNum)
tableNum
- Number of the table to be removed.public void removePlayer(int tableNum, String player)
tableNum
- Table number.player
- public void removeUserFromTables(String player)
player
- public Table getTable(int tableNum)
tableNum
- Table number.
public int[] getTablesNumbers()
public void updateTable(int tableNum, Table table)
tableNum
- table
- public int size()
public int[] getTableNumsForUser(String username)
username
-
public int getNumOfTablesUserOwns(String username)
username
- Username to check.
public Integer computeNewTableNum()
public XMLElement flatten()
flatten
in interface ITransmittable
ITransmittable.flatten()
public void refreshObservers()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |