Scrapped using a Comparable for the keys to a DSet on this side of things.

- There is no such thing as Comparable in ActionScript, I had made my own,
  but String (one of the most common keys) couldn't implement it, and String
  is a final class (like in Java). It would be a huge inconvenience to have
  to wrap String objects.
- The language also has no .equals() method in the base class. The strict
  equality operator (===) works like equals() except that objects that
  aren't one of the base types (String, Number, Boolean, int) are compared
  by reference. I added a "Equalable" interface, if the key in a DSet
  implements that interface then equals() is called, otherwise the strict
  equality operator is used.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3897 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2006-03-01 19:43:22 +00:00
parent ee25f8f1a8
commit 703b309108
6 changed files with 48 additions and 58 deletions
+13
View File
@@ -0,0 +1,13 @@
package com.threerings.util {
/**
* An interface we can use to implement equals(), which is standard and
* very useful in Java.
*/
public interface Equalable {
/**
* Return true to see if this instance is equal to the specified object.
*/
function equals (other :Object) :Boolean;
}
}