| Package | org.as3collections.maps |
| Class | public class ReadOnlyHashMap |
| Inheritance | ReadOnlyHashMap AbstractHashMap Object |
HashMap that doesn't allow modifications.
It receives all the mappings by its constructor and can no longer be changed.
All methods that change the map will throw an UnsupportedOperationError.
| Method | Defined By | ||
|---|---|---|---|
ReadOnlyHashMap(source:IMap)
Constructor, creates a new ReadOnlyHashMap object. | ReadOnlyHashMap | ||
clear():void [override]
This implementation always throws an UnsupportedOperationError. | ReadOnlyHashMap | ||
clone():* [override]
Creates and return a new ReadOnlyHashMap object containing all mappings in this map. | ReadOnlyHashMap | ||
![]() | containsKey(key:*):Boolean
Returns true if this map contains a mapping for the specified key. | AbstractHashMap | |
![]() | containsValue(value:*):Boolean
Returns true if this map maps one or more keys to the specified value. | AbstractHashMap | |
![]() |
Returns an ArrayList object that is a view of the mappings contained in this map. | AbstractHashMap | |
![]() | equals(other:*):Boolean
This method uses MapUtil.equalNotConsideringOrder method to perform equality, sending this map and other argument. | AbstractHashMap | |
![]() |
Returns an ArrayList object that is a view of the keys contained in this map. | AbstractHashMap | |
![]() | getValue(key:*):*
Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key. | AbstractHashMap | |
![]() |
Returns an ArrayList object that is a view of the values contained in this map. | AbstractHashMap | |
![]() | isEmpty():Boolean
Returns true if this map contains no key-value mappings. | AbstractHashMap | |
[override]
Returns an iterator over a set of mappings. | ReadOnlyHashMap | ||
put(key:*, value:*):* [override]
This implementation always throws an UnsupportedOperationError. | ReadOnlyHashMap | ||
[override]
This implementation always throws an UnsupportedOperationError. | ReadOnlyHashMap | ||
putAllByObject(o:Object):void [override]
This implementation always throws an UnsupportedOperationError. | ReadOnlyHashMap | ||
[override]
This implementation always throws an UnsupportedOperationError. | ReadOnlyHashMap | ||
remove(key:*):* [override]
This implementation always throws an UnsupportedOperationError. | ReadOnlyHashMap | ||
removeAll(keys:ICollection):Boolean [override]
This implementation always throws an UnsupportedOperationError. | ReadOnlyHashMap | ||
retainAll(keys:ICollection):Boolean [override]
This implementation always throws an UnsupportedOperationError. | ReadOnlyHashMap | ||
![]() | size():int
Returns the number of key-value mappings in this map. | AbstractHashMap | |
![]() | toString():String
Returns the string representation of this instance. | AbstractHashMap | |
| ReadOnlyHashMap | () | Constructor |
public function ReadOnlyHashMap(source:IMap)
Constructor, creates a new ReadOnlyHashMap object.
source:IMap — an map to fill the list.
|
ArgumentError — if the source argument is null.
|
| clear | () | method |
override public function clear():void
This implementation always throws an UnsupportedOperationError.
org.as3coreaddendum.errors:UnsupportedOperationError — ReadOnlyHashMap is a read-only map and doesn't allow modifications.
|
| clone | () | method |
override public function clone():*
Creates and return a new ReadOnlyHashMap object containing all mappings in this map.
* — a new ReadOnlyHashMap object containing all mappings in this map.
|
| iterator | () | method |
override public function iterator():IIteratorReturns an iterator over a set of mappings.
This implementation returns a ReadOnlyMapIterator object.
IIterator — an iterator over a set of values.
|
See also
| put | () | method |
override public function put(key:*, value:*):*
This implementation always throws an UnsupportedOperationError.
Parameters
key:* | |
value:* |
* —
|
org.as3coreaddendum.errors:UnsupportedOperationError — ReadOnlyHashMap is a read-only map and doesn't allow modifications.
|
| putAll | () | method |
override public function putAll(map:IMap):void
This implementation always throws an UnsupportedOperationError.
Parameters
map:IMap |
org.as3coreaddendum.errors:UnsupportedOperationError — ReadOnlyHashMap is a read-only map and doesn't allow modifications.
|
| putAllByObject | () | method |
override public function putAllByObject(o:Object):void
This implementation always throws an UnsupportedOperationError.
Parameters
o:Object |
org.as3coreaddendum.errors:UnsupportedOperationError — ReadOnlyHashMap is a read-only map and doesn't allow modifications.
|
| putEntry | () | method |
override public function putEntry(entry:IMapEntry):*
This implementation always throws an UnsupportedOperationError.
Parameters
entry:IMapEntry |
* —
|
org.as3coreaddendum.errors:UnsupportedOperationError — ReadOnlyHashMap is a read-only map and doesn't allow modifications.
|
| remove | () | method |
override public function remove(key:*):*
This implementation always throws an UnsupportedOperationError.
Parameters
key:* |
* —
|
org.as3coreaddendum.errors:UnsupportedOperationError — ReadOnlyHashMap is a read-only map and doesn't allow modifications.
|
| removeAll | () | method |
override public function removeAll(keys:ICollection):Boolean
This implementation always throws an UnsupportedOperationError.
Parameters
keys:ICollection |
Boolean —
|
org.as3coreaddendum.errors:UnsupportedOperationError — ReadOnlyHashMap is a read-only map and doesn't allow modifications.
|
| retainAll | () | method |
override public function retainAll(keys:ICollection):Boolean
This implementation always throws an UnsupportedOperationError.
Parameters
keys:ICollection |
Boolean —
|
org.as3coreaddendum.errors:UnsupportedOperationError — ReadOnlyHashMap is a read-only map and doesn't allow modifications.
|
import org.as3collections.IMap;
import org.as3collections.maps.HashMap;
import org.as3collections.maps.ReadOnlyHashMap;
var obj:Object = {fa:"fb",ga:"gb",ha:"hb"}
var map1:IMap = new HashMap();
map1.putAllByObject(obj);
map1 // {ha=hb,ga=gb,fa=fb}
map1.size() // 3
var map2:IMap = new ReadOnlyHashMap(map1);
map2 // {ha=hb,ga=gb,fa=fb}
map2.size() // 3
map2.put(1, 2) // UnsupportedOperationError: ReadOnlyHashMap is a read-only map and doesn't allow modifications.
map2.remove(1) // UnsupportedOperationError: ReadOnlyHashMap is a read-only map and doesn't allow modifications.