Tracked objects. Now to set about to figuring out what to track.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3075 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2004-08-13 23:44:16 +00:00
parent 3485019952
commit 864adbdc20
3 changed files with 115 additions and 2 deletions
@@ -0,0 +1,36 @@
//
// $Id: TrackedStreamableObject.java,v 1.1 2004/08/13 23:44:16 mdb Exp $
package com.threerings.io;
import com.samskivert.util.StringUtil;
import com.threerings.util.TrackedObject;
/**
* A simple serializable object implements the {@link Streamable}
* interface and provides a default {@link #toString} implementation which
* outputs all public members.
*/
public class TrackedStreamableObject extends TrackedObject
implements Streamable
{
/**
* Generates a string representation of this instance.
*/
public String toString ()
{
StringBuffer buf = new StringBuffer("[");
toString(buf);
return buf.append("]").toString();
}
/**
* Handles the toString-ification of all public members. Derived
* classes can override and include non-public members if desired.
*/
protected void toString (StringBuffer buf)
{
StringUtil.fieldsToString(buf, this);
}
}