net.walend.collection
Interface MutableMap

All Superinterfaces:
HasState, Map
All Known Subinterfaces:
MutableMapToFreezables
All Known Implementing Classes:
MutableFreezerHashMap, MutableHashMap, MutableHashMapToFreezables, SoftHashMap

public interface MutableMap
extends Map

MutableMap adds mutator methods to Map.

A MutableMap implementation should implement 6 constructors. 4 of these should return new empty maps. One constructor should take no arguments and create a Map of capacity 7 with the default Identitor. A second constructor should take integer arguments to specify the inital capacity of the Map. A third should take an Identitor as an argument, a forth should take both an Identitor and integer arguments to specify the Map's behavior. A fifth and sixth argument should take arguments of net.walend.collection.Map and java.util.Map and create shallow copies of those Maps.

Since:
20010705
Author:
David Walend

Field Summary
 
Fields inherited from interface net.walend.collection.Map
EMPTY
 
Method Summary
 void clear()
          Removes all key, value pairs from this Map.
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          Puts the key,value pair in the map.
 void putAll(Map map)
          Puts all of the key, value pairs in map into this Map.
 java.lang.Object remove(java.lang.Object key)
          Removes the key, value pair from this Map.
 
Methods inherited from interface net.walend.collection.Map
containsAll, containsKey, containsValue, get, getIdentitor, getJavaMap, getKeys, getValues, isEmpty, keyIterator, sameContentsAs, size, valueIterator
 
Methods inherited from interface net.walend.collection.HasState
getPrincipleInterface, sameStateAs
 

Method Detail

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Puts the key,value pair in the map. Returns the previous value associated with key. If no value was associated, returns null.

Throws:
java.lang.NullPointerException - if the key or value is null.

remove

public java.lang.Object remove(java.lang.Object key)
Removes the key, value pair from this Map. Returns the value associated with key, or null if no value was associated.

Throws:
java.lang.NullPointerException - if the key is null.

putAll

public void putAll(Map map)
Puts all of the key, value pairs in map into this Map. map's pairs replace any conflicting pairs in this Map.

Throws:
java.lang.NullPointerException - if map is null.

clear

public void clear()
Removes all key, value pairs from this Map.



Copyright (c) 2000, 2001, David Walend