Packageorg.as3collections.maps
Classpublic class ReadOnlyArrayListMap
InheritanceReadOnlyArrayListMap Inheritance AbstractListMap Inheritance Object

An ArrayListMap 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.

View the examples



Public Properties
 PropertyDefined By
 InheritedallKeysEquatable : Boolean
[read-only] Indicates whether all keys in this map implements org.as3coreaddendum.system.IEquatable interface.
AbstractListMap
 InheritedallValuesEquatable : Boolean
[read-only] Indicates whether all values in this map implements org.as3coreaddendum.system.IEquatable interface.
AbstractListMap
 InheritedmodCount : int
[read-only] The number of times this map has been structurally modified.
AbstractListMap
Protected Properties
 PropertyDefined By
 Inheritedkeys : IList
AbstractListMap
 Inheritedvalues : IList
AbstractListMap
Public Methods
 MethodDefined By
  
Constructor, creates a new ReadOnlyArrayListMap object.
ReadOnlyArrayListMap
  
clear():void
[override] This implementation always throws an UnsupportedOperationError.
ReadOnlyArrayListMap
  
clone():*
[override] Creates and return a new ReadOnlyArrayListMap object containing all mappings in this map (in the same order).
ReadOnlyArrayListMap
 Inherited
containsKey(key:*):Boolean
Returns true if this map contains a mapping for the specified key.
AbstractListMap
 Inherited
containsValue(value:*):Boolean
Returns true if this map maps one or more keys to the specified value.
AbstractListMap
 Inherited
Returns an ArrayList object that is a view of the mappings contained in this map (in the same order).
AbstractListMap
 Inherited
equals(other:*):Boolean
This method uses MapUtil.equalConsideringOrder method to perform equality, sending this map and other argument.
AbstractListMap
 Inherited
getKeyAt(index:int):*
Returns the key at the specified position in this map.
AbstractListMap
 Inherited
Returns an ArrayList object that is a view of the keys contained in this map.
AbstractListMap
 Inherited
getValue(key:*):*
Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.
AbstractListMap
 Inherited
getValueAt(index:int):*
Returns the value at the specified position in this map.
AbstractListMap
 Inherited
Returns an ArrayList object that is a view of the values contained in this map.
AbstractListMap
 Inherited
headMap(toKey:*):IListMap
Returns a new IListMap object that is a view of the portion of this map whose keys are strictly less than toKey.
AbstractListMap
 Inherited
indexOfKey(key:*):int
Returns the position of the specified key.
AbstractListMap
 Inherited
indexOfValue(value:*):int
Returns the position of the specified value.
AbstractListMap
 Inherited
isEmpty():Boolean
Returns true if this map contains no key-value mappings.
AbstractListMap
  
[override] Returns an iterator over a set of mappings.
ReadOnlyArrayListMap
 Inherited
Returns a IListMapIterator object to iterate over the mappings in this map (in proper sequence), starting at the specified position in this map.
AbstractListMap
  
put(key:*, value:*):*
[override] This implementation always throws an UnsupportedOperationError.
ReadOnlyArrayListMap
  
putAll(map:IMap):void
[override] This implementation always throws an UnsupportedOperationError.
ReadOnlyArrayListMap
 Inherited
putAllAt(index:int, map:IMap):void
Copies all of the mappings from the specified map to this map (optional operation).
AbstractListMap
  
putAllByObject(o:Object):void
[override] This implementation always throws an UnsupportedOperationError.
ReadOnlyArrayListMap
 Inherited
putAt(index:int, key:*, value:*):void
Associates the specified value with the specified key at the specified position in this map (optional operation).
AbstractListMap
  
[override] This implementation always throws an UnsupportedOperationError.
ReadOnlyArrayListMap
  
remove(key:*):*
[override] This implementation always throws an UnsupportedOperationError.
ReadOnlyArrayListMap
  
removeAll(keys:ICollection):Boolean
[override] This implementation always throws an UnsupportedOperationError.
ReadOnlyArrayListMap
 Inherited
removeAt(index:int):IMapEntry
Removes the mapping at the specified position in this map (optional operation).
AbstractListMap
 Inherited
removeRange(fromIndex:int, toIndex:int):IListMap
Removes all of the mappings whose index is between fromIndex, inclusive, and toIndex, exclusive (optional operation).
AbstractListMap
  
retainAll(keys:ICollection):Boolean
[override] This implementation always throws an UnsupportedOperationError.
ReadOnlyArrayListMap
 Inherited
reverse():void
Reverses the order of the mappings in this map.
AbstractListMap
 Inherited
setKeyAt(index:int, key:*):*
Replaces the key at the specified position in this map with the specified key (optional operation).
AbstractListMap
 Inherited
setValueAt(index:int, value:*):*
Replaces the value at the specified position in this map with the specified value (optional operation).
AbstractListMap
 Inherited
size():int
Returns the number of key-value mappings in this map.
AbstractListMap
 Inherited
subMap(fromIndex:int, toIndex:int):IListMap
Returns a new map that is a view of the portion of this map between the specified fromIndex, inclusive, and toIndex, exclusive.
AbstractListMap
 Inherited
tailMap(fromKey:*):IListMap
Returns a new IListMap object that is a view of the portion of this map whose keys are greater than or equal to fromKey.
AbstractListMap
 Inherited
toString():String
Returns the string representation of this instance.
AbstractListMap
Constructor Detail
ReadOnlyArrayListMap()Constructor
public function ReadOnlyArrayListMap(source:IMap)

Constructor, creates a new ReadOnlyArrayListMap object.

Parameters
source:IMap — an map to fill the list.

Throws
ArgumentError — if the source argument is null.
Method Detail
clear()method
override public function clear():void

This implementation always throws an UnsupportedOperationError.


Throws
org.as3coreaddendum.errors:UnsupportedOperationError ReadOnlyArrayListMap is a read-only map and doesn't allow modifications.
clone()method 
override public function clone():*

Creates and return a new ReadOnlyArrayListMap object containing all mappings in this map (in the same order).

Returns
* — a new ReadOnlyArrayListMap object containing all mappings in this map (in the same order).
iterator()method 
override public function iterator():IIterator

Returns an iterator over a set of mappings.

This implementation returns a ReadOnlyMapIterator object.

Returns
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:*

Returns
*

Throws
org.as3coreaddendum.errors:UnsupportedOperationError ReadOnlyArrayListMap 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


Throws
org.as3coreaddendum.errors:UnsupportedOperationError ReadOnlyArrayListMap 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


Throws
org.as3coreaddendum.errors:UnsupportedOperationError ReadOnlyArrayListMap 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

Returns
*

Throws
org.as3coreaddendum.errors:UnsupportedOperationError ReadOnlyArrayListMap 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:*

Returns
*

Throws
org.as3coreaddendum.errors:UnsupportedOperationError ReadOnlyArrayListMap 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

Returns
Boolean

Throws
org.as3coreaddendum.errors:UnsupportedOperationError ReadOnlyArrayListMap 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

Returns
Boolean

Throws
org.as3coreaddendum.errors:UnsupportedOperationError ReadOnlyArrayListMap is a read-only map and doesn't allow modifications.
Examples
     import org.as3collections.IMap;
     import org.as3collections.maps.ArrayListMap;
     import org.as3collections.maps.ReadOnlyArrayListMap;
     
     var map1:IMap = new ArrayListMap();
     
     map1.put("fa", "fb"):     // null
     map1.put("ga", "gb"):     // null
     map1.put("ha", "hb"):     // null
     
     map1                      // {fa=fb,ga=gb,ha=hb}
     map1.size()               // 3
     
     var map2:IMap = new ReadOnlyArrayListMap(map1);
     
     map2                      // {fa=fb,ga=gb,ha=hb}
     map2.size()               // 3
     
     map2.put(1, 2)            // UnsupportedOperationError: ReadOnlyArrayListMap is a read-only map and doesn't allow modifications.
     
     map2.remove(1)            // UnsupportedOperationError: ReadOnlyArrayListMap is a read-only map and doesn't allow modifications.