- Changed Table to just have an int as its key and use autoboxing to make

that a Comparable. It's a slight performance hit, as when a DSet is
  binary searched, it will be boxing up an int for every entry examined.
  Oh well.
- Use some generics.
- Some other cleanups I spotted while writing actionscript versions.


git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@29 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
Ray Greenwell
2006-07-28 02:03:53 +00:00
parent 4914a11160
commit b82ab59b1d
8 changed files with 28 additions and 39 deletions
+4 -12
View File
@@ -43,7 +43,7 @@ public class Table
implements DSet.Entry, ParlorCodes
{
/** The unique identifier for this table. */
public Integer tableId;
public int tableId;
/** The object id of the lobby object with which this table is
* associated. */
@@ -80,7 +80,7 @@ public class Table
public Table (int lobbyOid, TableConfig tconfig, GameConfig config)
{
// assign a unique table id
tableId = Integer.valueOf(++_tableIdCounter);
tableId = ++_tableIdCounter;
// keep track of our lobby oid
this.lobbyOid = lobbyOid;
@@ -109,14 +109,6 @@ public class Table
public Table ()
{
}
/**
* A convenience function for accessing the table id as an int.
*/
public int getTableId ()
{
return tableId.intValue();
}
/**
* Returns true if there is no one sitting at this table.
@@ -363,13 +355,13 @@ public class Table
public boolean equals (Object other)
{
return (other instanceof Table) &&
tableId.equals(((Table) other).tableId);
(tableId == ((Table) other).tableId);
}
// documentation inherited
public int hashCode ()
{
return tableId.intValue();
return tableId;
}
/**