Files
narya/src/as/com/threerings/util/HashMap.as
T
Ray Greenwell f778c1e518 - Created a Map interface.
- Renamed HashMap Hashtable, because I wanted a version without ties to
  mx.* code. User-defined hashing functions may be specified.
- Created a subclass of Hashtable called HashMap which uses
  functions in mx.utils.ObjectUtil to hash non-Hashable complex keys.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4120 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-05-16 19:02:24 +00:00

22 lines
532 B
ActionScript

package com.threerings.util {
import mx.utils.ObjectUtil;
/**
* A Hashtable implementation that utilizes ObjectUtil.compare and
* ObjectUtil.toString for hashing keys that are non-simple and do
* not implement Hashable.
*/
public class HashMap extends Hashtable
{
public function HashMap (loadFactor :Number = 1.75)
{
super(loadFactor,
function (o1 :Object, o2 :Object) :Boolean {
return (0 == ObjectUtil.compare(o1, o2));
},
ObjectUtil.toString);
}
}
}