Provide an easy way to add to toString() info.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3806 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -377,12 +377,24 @@ public class Table
|
|||||||
*/
|
*/
|
||||||
public String toString ()
|
public String toString ()
|
||||||
{
|
{
|
||||||
return "[tableId=" + tableId +
|
StringBuffer buf = new StringBuffer();
|
||||||
", lobbyOid=" + lobbyOid +
|
buf.append(StringUtil.shortClassName(this));
|
||||||
", gameOid=" + gameOid +
|
buf.append(" [");
|
||||||
", occupants=" + StringUtil.toString(occupants) +
|
toString(buf);
|
||||||
", bodyOids=" + StringUtil.toString(bodyOids) +
|
buf.append("]");
|
||||||
", config=" + config + "]";
|
return buf.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper method for toString, ripe for overrideability.
|
||||||
|
*/
|
||||||
|
protected void toString (StringBuffer buf)
|
||||||
|
{
|
||||||
|
buf.append("tableId=").append(tableId);
|
||||||
|
buf.append(", lobbyOid=").append(lobbyOid);
|
||||||
|
buf.append(", gameOid=").append(gameOid);
|
||||||
|
buf.append(", occupants=").append(StringUtil.toString(occupants));
|
||||||
|
buf.append(", config=").append(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** A counter for assigning table ids. */
|
/** A counter for assigning table ids. */
|
||||||
|
|||||||
Reference in New Issue
Block a user