Packagecom.adobe.portfolio.utils
Classpublic class OrderedDictionary
InheritanceOrderedDictionary Inheritance Object

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

The OrderedDictionary class implements an ordered dictionary. Elements can be pushed/popped to/from the end of the list, as while as shifted/unshifted to/from the beginning of the list.



Public Properties
 PropertyDefined By
  length : uint
[read-only] The length of the dictionary
OrderedDictionary
  orderedKeys : Array
[read-only] Gets the keys in the order stored.
OrderedDictionary
Public Methods
 MethodDefined By
  
OrderedDictionary(weakKeys:Boolean = false)
Constructor
OrderedDictionary
  
clear():void
Clears the dictionary of all entries.
OrderedDictionary
  
getValue(key:Object):*
Gets the value of the specified key.
OrderedDictionary
  
getValueByIndex(index:int):*
Get a value by index
OrderedDictionary
  
isKeyValueMatch(key:Object, value:*):Boolean
Returns true if the dictionary has a key that matches the specified key/value pair.
OrderedDictionary
  
keyExists(key:Object):Boolean
Returns true if the dictionary has the specified key
OrderedDictionary
  
pop():*
Pops the last key/value pair from the end of the dictionary and returns its value
OrderedDictionary
  
push(key:Object, value:* = null):void
Pushes the key/value pair onto the end of the dictionary
OrderedDictionary
  
remove(key:Object):Boolean
Removes a key/value from the dictionary
OrderedDictionary
  
shift():*
Shifts the first key/value pair from the beginning of the dictionary and returns its value
OrderedDictionary
  
unshift(key:Object, value:* = null):void
Unshifts (inserts) the key/value pair at the beginning of the dictionary.
OrderedDictionary
Property Detail
lengthproperty
length:uint  [read-only]

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

The length of the dictionary


Implementation
    public function get length():uint
orderedKeysproperty 
orderedKeys:Array  [read-only]

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Gets the keys in the order stored.


Implementation
    public function get orderedKeys():Array
Constructor Detail
OrderedDictionary()Constructor
public function OrderedDictionary(weakKeys:Boolean = false)

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Constructor

Parameters
weakKeys:Boolean (default = false) — whether to use weak keys for the OrderedDictionary entries
Method Detail
clear()method
public function clear():void

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Clears the dictionary of all entries.

getValue()method 
public function getValue(key:Object):*

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Gets the value of the specified key.

Parameters

key:Object — The key

Returns
* — The value (null if the key doesn't exist)
getValueByIndex()method 
public function getValueByIndex(index:int):*

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Get a value by index

Parameters

index:int — index of the desired key/value pair

Returns
* — The value
isKeyValueMatch()method 
public function isKeyValueMatch(key:Object, value:*):Boolean

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Returns true if the dictionary has a key that matches the specified key/value pair.

Parameters

key:Object — The key
 
value:* — The value

Returns
Boolean — true if the dictionary contains the key and matches the value.
keyExists()method 
public function keyExists(key:Object):Boolean

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Returns true if the dictionary has the specified key

Parameters

key:Object — The key

Returns
Boolean — true if the dictionary contains the key The value of the key must be non-null)
pop()method 
public function pop():*

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Pops the last key/value pair from the end of the dictionary and returns its value

Returns
* — The value
push()method 
public function push(key:Object, value:* = null):void

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Pushes the key/value pair onto the end of the dictionary

Parameters

key:Object — The key
 
value:* (default = null) — The value (if null, then the key is used as a value)

remove()method 
public function remove(key:Object):Boolean

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Removes a key/value from the dictionary

Parameters

key:Object — The key

Returns
Boolean — True if the key exists and the key/value was removed.
shift()method 
public function shift():*

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Shifts the first key/value pair from the beginning of the dictionary and returns its value

Returns
* — The value
unshift()method 
public function unshift(key:Object, value:* = null):void

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Unshifts (inserts) the key/value pair at the beginning of the dictionary.

Parameters

key:Object — The key
 
value:* (default = null) — The value (if null, then the key is used as a value)