Added the values() function to the Map interface, as well as a new method,
forEach(), in which you pass a visitor function that will visit each key/value stored in the map. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4257 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -21,6 +21,12 @@ public interface Map
|
||||
*/
|
||||
function get (key :Object) :*;
|
||||
|
||||
/**
|
||||
* Call the specified function, which accepts to args: key and value,
|
||||
* for every mapping.
|
||||
*/
|
||||
function forEach (fn :Function) :void;
|
||||
|
||||
/**
|
||||
* Returns true if this map contains no elements.
|
||||
*/
|
||||
@@ -47,6 +53,11 @@ public interface Map
|
||||
* Return the current size of the map.
|
||||
*/
|
||||
function size () :int;
|
||||
|
||||
/**
|
||||
* Return all the values in this Map, in Array form.
|
||||
*/
|
||||
function values () :Array;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user