A Ceylon MutableMap that wraps a JMap.

If the given map contains null elements, an optional Item type must be explicitly specified, for example:


If a non-optional Item type is specified, an AssertionError will occur whenever a null item is encountered while iterating the map.

no subtypes hierarchy

CeylonMutableMap(JMap<Key,Item> map)
Inherited Attributes
Attributes inherited from: CeylonMap<Key,Item>
Attributes inherited from: Object
Attributes inherited from: Collection<Element>
Attributes inherited from: Correspondence<Key,Item>
Attributes inherited from: Iterable<Element,Absent>
Attributes inherited from: Map<Key,Item>
clearSource Codeshared actual void clear()

Remove every entry from this map, leaving an empty map with no entries.

cloneSource Codeshared actual MutableMap<Key,Item> clone()

A shallow copy of this collection, that is, a collection with identical elements which does not change if this collection changes. If this collection is immutable, it is acceptable to return a reference to this collection. If this collection is mutable, a newly instantiated collection must be returned.

Refines CeylonMap.clone ultimately refines Collection.clone
putSource Codeshared actual Item? put(Key key, Item item)

Set the item associated with the given key to the given item. If there is already an item associated with this key, replace the association. Otherwise, create a new association.

For any instance c of KeyedCorrespondenceMutator, c.put(key, item) may be written using the item and assignment operators:

c[key] = item
removeSource Codeshared actual Item? remove(Key key)

Remove the entry associated with the given key, if any, from this map, returning the value no longer associated with the given key, if any, or null if there was no entry associated with the given key.

Refines MutableMap.remove ultimately refines MapMutator.remove
Inherited Methods
Methods inherited from: CeylonMap<Key,Item>
Methods inherited from: Object
Methods inherited from: Category<Element>
Methods inherited from: Collection<Element>
Methods inherited from: Correspondence<Key,Item>
Methods inherited from: Iterable<Element,Absent>
Methods inherited from: KeyedCorrespondenceMutator<Key,Item>
Methods inherited from: Map<Key,Item>
Methods inherited from: MapMutator<Key,Item>
Methods inherited from: MutableMap<Key,Item>