- Method comments.
- Track the size of non-simple keys separately so that we really know when to resize the map. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4121 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,19 +1,46 @@
|
||||
package com.threerings.util {
|
||||
|
||||
/**
|
||||
* A Map is an object that maps keys to values.
|
||||
*/
|
||||
public interface Map
|
||||
{
|
||||
/**
|
||||
* Clear this map, removing all stored elements.
|
||||
*/
|
||||
function clear () :void;
|
||||
|
||||
/**
|
||||
* Returns true if the specified key exists in the map.
|
||||
*/
|
||||
function containsKey (key :Object) :Boolean;
|
||||
|
||||
/**
|
||||
* Retrieve the value stored in this map for the specified key.
|
||||
* Returns the value, or undefined if there is no mapping for the key.
|
||||
*/
|
||||
function get (key :Object) :*;
|
||||
|
||||
/**
|
||||
* Returns true if this map contains no elements.
|
||||
*/
|
||||
function isEmpty () :Boolean;
|
||||
|
||||
/**
|
||||
* Store a value in the map associated with the specified key.
|
||||
* Returns the previous value stored for that key, or undefined.
|
||||
*/
|
||||
function put (key :Object, value :Object) :*;
|
||||
|
||||
/**
|
||||
* Removes the mapping for the specified key.
|
||||
* Returns the value that had been stored, or undefined.
|
||||
*/
|
||||
function remove (key :Object) :*;
|
||||
|
||||
/**
|
||||
* Return the current size of the map.
|
||||
*/
|
||||
function size () :int;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user