Packagech.capi.data
Classpublic class TreeMap
InheritanceTreeMap Inheritance DictionnaryMap Inheritance Object
Implements IMap

A TreeMap is a simply structured IMap that can have a parent IMap to search some keys. Note that the methods remove() and clear() won't affect the parent IMap.



Public Properties
 PropertyDefined By
  parent : IMap
Defines the parent IMap to look for the variables.
TreeMap
Public Methods
 MethodDefined By
  
TreeMap(parentMap:IMap = null, weakKeys:Boolean = false)
Creates a new TreeMap object.
TreeMap
 Inherited
clear():void
Removes all of the mappings from this map.
DictionnaryMap
  
clearAll():void
Clears the current TreeMap and also clear its parent.
TreeMap
  
containsKey(key:*):Boolean
Returns true if this map contains a mapping for the specified key.
TreeMap
  
containsValue(value:*):Boolean
Returns true if this map maps one or more keys to the specified value.
TreeMap
  
getValue(key:*):*
Retrieves the value mapped to the specified key or null if there is no mapping for the key.
TreeMap
  
isEmpty():Boolean
Returns true if the IMap contains no key-value mappings.
TreeMap
  
keys():Array
Retrieves all the keys contained in the IMap and its parent.
TreeMap
 Inherited
matches(obj:Object, strict:Boolean = false):Boolean
Compares the IMap and the specified Object pairs key/value and checks if the values are the same.
DictionnaryMap
 Inherited
put(key:*, value:*):*
Associates the specified value with the specified key in the IMap.
DictionnaryMap
 Inherited
putAll(source:IMap):void
Retrieves all the key/value from the source IMap and put them in the current IMap.
DictionnaryMap
 Inherited
putObject(obj:Object):void
Puts all the key/value from the specified object in the IMap.
DictionnaryMap
 Inherited
remove(key:*):*
Removes the mapping for a key from the IMap if it is present.
DictionnaryMap
  
size():uint
Retrieves the number of key-value mappings in the IMap and its parent.
TreeMap
 Inherited
toObject():Object
Returns an Object from the IMap.
DictionnaryMap
  
toString():String
Retrieves a String displaying all the key/value pairs of the TreeMap including its parent IMap.
TreeMap
  
values():Array
Retrieves all the values contained in the IMap and its parent.
TreeMap
Property Detail
parentproperty
parent:IMap  [read-write]

Defines the parent IMap to look for the variables.


Implementation
    public function get parent():IMap
    public function set parent(value:IMap):void
Constructor Detail
TreeMap()Constructor
public function TreeMap(parentMap:IMap = null, weakKeys:Boolean = false)

Creates a new TreeMap object.

Parameters
parentMap:IMap (default = null) — The parent IMap.
 
weakKeys:Boolean (default = false) — Defines if the keys are weak references.
Method Detail
clearAll()method
public function clearAll():void

Clears the current TreeMap and also clear its parent. If the parent IMap is also a TreeMap, the clearAll() method is called, else the clear() method is called.

containsKey()method 
override public function containsKey(key:*):Boolean

Returns true if this map contains a mapping for the specified key. If the key isn't found in the current TreeMap, then it will be searched in the parent IMap.

Parameters

key:* — The key.

Returns
Booleantrue if the specified key is contained in the IMap.
containsValue()method 
override public function containsValue(value:*):Boolean

Returns true if this map maps one or more keys to the specified value. If the value isn't found in the current TreeMap, then it will be searched in the parent IMap.

Parameters

value:* — The value.

Returns
Booleantrue if the specified value is contained in the IMap.
getValue()method 
override public function getValue(key:*):*

Retrieves the value mapped to the specified key or null if there is no mapping for the key. If the value is null, it will be searched in the parent IMap.

Parameters

key:* — The key.

Returns
* — The object mapped to the specified key or null.
isEmpty()method 
override public function isEmpty():Boolean

Returns true if the IMap contains no key-value mappings. Both parent and current TreeMap must be empty.

Returns
Booleantrue if there is no mapping in the TreeMap and its parent.
keys()method 
override public function keys():Array

Retrieves all the keys contained in the IMap and its parent.

Returns
Array — An Array containing all the keys.
size()method 
override public function size():uint

Retrieves the number of key-value mappings in the IMap and its parent.

Returns
uint — The number of key-value mappings.
toString()method 
override public function toString():String

Retrieves a String displaying all the key/value pairs of the TreeMap including its parent IMap.

Returns
String — A String representing the TreeMap.
values()method 
override public function values():Array

Retrieves all the values contained in the IMap and its parent.

Returns
Array — An Array containing all the values.