Revamped toString() to be more derived class friendly. Added a

ReleaseLockEvent which will be used by the distributed object locking
facilities.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@169 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2001-08-04 00:32:11 +00:00
parent 31d1aa1edb
commit a831089362
7 changed files with 152 additions and 18 deletions
@@ -1,5 +1,5 @@
//
// $Id: DEvent.java,v 1.4 2001/07/19 18:08:20 mdb Exp $
// $Id: DEvent.java,v 1.5 2001/08/04 00:32:11 mdb Exp $
package com.threerings.cocktail.cher.dobj;
@@ -63,6 +63,29 @@ public abstract class DEvent
_toid = targetOid;
}
/**
* Constructs and returns a string representation of this event.
*/
public String toString ()
{
StringBuffer buf = new StringBuffer();
buf.append("[");
toString(buf);
buf.append("]");
return buf.toString();
}
/**
* This should be overridden by derived classes (which should be sure
* to call <code>super.toString()</code>) to append the derived class
* specific event information to the string buffer.
*/
protected void toString (StringBuffer buf)
{
buf.append("targetOid=").append(_toid);
buf.append(", sourceOid=").append(_soid);
}
/** The oid of the object that is the target of this event. */
protected int _toid;