Various cleanuppery.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4118 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2006-05-16 01:51:01 +00:00
parent c203c0e861
commit 8604a4ac6a
4 changed files with 15 additions and 6 deletions
+13 -2
View File
@@ -7,7 +7,7 @@ import com.threerings.io.ObjectOutputStream;
import com.threerings.io.Streamable;
public class Name extends Object
implements Equalable, Streamable
implements Hashable, Streamable
{
public function Name (name :String = "")
{
@@ -37,13 +37,24 @@ public class Name extends Object
return _name;
}
// documentation inherited from interface Equalable
// documentation inherited from interface Hashable
public function equals (other :Object) :Boolean
{
return (other is Name) &&
(getNormal() === (other as Name).getNormal());
}
// documentation inherited from interface Hashable
public function hashCode () :int
{
var norm :String = getNormal();
var hash :int = 0;
for (var ii :int = 0; ii < norm.length; ii++) {
hash = (hash << 1) ^ int(norm.charCodeAt(ii));
}
return hash;
}
// documentation inherited from interface Streamable
public function writeObject (out :ObjectOutputStream) :void
//throws IOError