Packagesystem.data.maps
Classpublic class TypedMap
InheritanceTypedMap Inheritance Object
Implements Map, Typeable, Validator

TypedMap is a wrapper for Map instances that ensures that only values of a specific type can be added to the wrapped Map.



Public Properties
 PropertyDefined By
  type : *
Indicates the type of the Typeable object.
TypedMap
Public Methods
 MethodDefined By
  
TypedMap(type:*, map:Map)
Creates a new TypedMap instance.
TypedMap
  
clear():void
Removes all mappings from this map (optional operation).
TypedMap
  
clone():*
Returns a shallow copy of the map.
TypedMap
  
containsKey(key:*):Boolean
Returns true if this map contains a mapping for the specified key.
TypedMap
  
containsValue(value:*):Boolean
Returns true if this map maps one or more keys to the specified value.
TypedMap
  
get(key:*):*
Returns the value to which this map maps the specified key.
TypedMap
  
getKeys():Array
Returns an Array of all the keys in the map.
TypedMap
  
getValues():Array
Returns an Array of all the values in the map.
TypedMap
  
isEmpty():Boolean
Returns true if this map contains no key-value mappings.
TypedMap
  
Returns the iterator reference of the object.
TypedMap
  
Returns the keys iterator of this map.
TypedMap
  
put(key:*, value:*):*
Associates the specified value with the specified key in this map (optional operation).
TypedMap
  
putAll(m:Map):void
Copies all of the mappings from the specified map to this one.
TypedMap
  
remove(o:*):*
Removes the mapping for this key from this map if it is present (optional operation).
TypedMap
  
size():uint
Returns the number of key-value mappings in this map.
TypedMap
  
supports(value:*):Boolean
Returns true if the specific value is valid.
TypedMap
  
toSource(indent:int = 0):String
Returns the source code string representation of the object.
TypedMap
  
toString():String
Returns the String representation of the object.
TypedMap
  
validate(value:*):void
Evaluates the condition it checks and updates the IsValid property.
TypedMap
Property Detail
typeproperty
type:*

Indicates the type of the Typeable object.

If the type change the clear() method is invoked.


Implementation
    public function get type():*
    public function set type(value:any):void
Constructor Detail
TypedMap()Constructor
public function TypedMap(type:*, map:Map)

Creates a new TypedMap instance.

Parameters
type:* — the type of this Typeable object (a Class or a Function).
 
map:Map — The Map reference of this wrapper.

Throws
ArgumentError — if the type is null or undefined.
 
TypeError — if a value in the init object isn't valid.
Method Detail
clear()method
public function clear():void

Removes all mappings from this map (optional operation).

clone()method 
public function clone():*

Returns a shallow copy of the map.

Returns
* — a shallow copy of the map.
containsKey()method 
public function containsKey(key:*):Boolean

Returns true if this map contains a mapping for the specified key.

Parameters

key:*

Returns
Booleantrue if this map contains a mapping for the specified key.
containsValue()method 
public function containsValue(value:*):Boolean

Returns true if this map maps one or more keys to the specified value.

Parameters

value:*

Returns
Booleantrue if this map maps one or more keys to the specified value.
get()method 
public function get(key:*):*

Returns the value to which this map maps the specified key.

Parameters

key:*

Returns
* — the value to which this map maps the specified key.
getKeys()method 
public function getKeys():Array

Returns an Array of all the keys in the map.

Returns
Array — an Array of all the keys in the map.
getValues()method 
public function getValues():Array

Returns an Array of all the values in the map.

Returns
Array — an Array of all the values in the map.
isEmpty()method 
public function isEmpty():Boolean

Returns true if this map contains no key-value mappings.

Returns
Booleantrue if this map contains no key-value mappings.
iterator()method 
public function iterator():Iterator

Returns the iterator reference of the object.

Returns
Iterator — the iterator reference of the object.
keyIterator()method 
public function keyIterator():Iterator

Returns the keys iterator of this map.

Returns
Iterator — the keys iterator of this map.
put()method 
public function put(key:*, value:*):*

Associates the specified value with the specified key in this map (optional operation).

Parameters

key:*
 
value:*

Returns
*
putAll()method 
public function putAll(m:Map):void

Copies all of the mappings from the specified map to this one.

Parameters

m:Map

remove()method 
public function remove(o:*):*

Removes the mapping for this key from this map if it is present (optional operation).

Parameters

o:*

Returns
*
size()method 
public function size():uint

Returns the number of key-value mappings in this map.

Returns
uint — the number of key-value mappings in this map.
supports()method 
public function supports(value:*):Boolean

Returns true if the specific value is valid.

Parameters

value:*

Returns
Booleantrue if the specific value is valid.
toSource()method 
public function toSource(indent:int = 0):String

Returns the source code string representation of the object.

Parameters

indent:int (default = 0)

Returns
String — the source code string representation of the object.
toString()method 
public function toString():String

Returns the String representation of the object.

Returns
String — the String representation of the object.
validate()method 
public function validate(value:*):void

Evaluates the condition it checks and updates the IsValid property.

Parameters

value:*