Packagenet.guttershark.util.collections
Classpublic final class OrderedDictionary
InheritanceOrderedDictionary Inheritance flash.utils.Proxy

The OrderedDictionary class provides a dictionary like collection which persists the order of entries similar to an array.
 
  var od:OrderedDictionary = new OrderedDictionary();
  od['test0'] = "foo";
  od['test1'] = "bar";
  od.push("test3","doe");
  
  trace(od['test1']);
  trace(od['test3']);
  
  trace(od.pop());
  
  var i:int = 0;
  var l:int = od.length;
  for(i;i<l;i++)
  { 
      trace(od[i]);
  }
  



Public Properties
 PropertyDefined by
  length : int
[read-only] A non-negative integer specifying the number of elements in the ordered dictionary.
OrderedDictionary
Public Methods
 MethodDefined by
  
OrderedDictionary(weakKeys:Boolean = false)
Constructor for OrderedDictionary instances.
OrderedDictionary
  
clone(weakKeys:Boolean = false):OrderedDictionary
Clone this OrderedDictionary.
OrderedDictionary
  
dispose():void
Dispose of this ordered dictionary.
OrderedDictionary
  
pop():*
Removes the last element from an ordered dictionary and returns the value of that element.
OrderedDictionary
  
push(name:*, value:*):int
Adds one or more elements to the end of an ordered dictionary and returns the new length of the array.
OrderedDictionary
  
shift():*
Removes the first element from an ordered dictionary and returns that element.
OrderedDictionary
  
splice(startIndex:int, deleteCount:int):OrderedDictionary
Remove multiple items from the ordered dictionary.
OrderedDictionary
  
Remove objects by multiple keys.
OrderedDictionary
  
unshift(name:*, value:*):int
Adds one or more elements to the beginning of an ordered dictionary and returns the new length of the array.
OrderedDictionary
Property detail
lengthproperty
length:int  [read-only]

A non-negative integer specifying the number of elements in the ordered dictionary.

Implementation
    public function get length():int
Constructor detail
OrderedDictionary()constructor
public function OrderedDictionary(weakKeys:Boolean = false)

Constructor for OrderedDictionary instances.

Parameters
weakKeys:Boolean (default = false) — Whether or not the dictionary's keys are weak references to objects.
Method detail
clone()method
public function clone(weakKeys:Boolean = false):OrderedDictionary

Clone this OrderedDictionary.

Parameters
weakKeys:Boolean (default = false) — Whether or not the new dictionary will have weak references to it's objects.

Returns
OrderedDictionary
dispose()method 
public function dispose():void

Dispose of this ordered dictionary.

pop()method 
public function pop():*

Removes the last element from an ordered dictionary and returns the value of that element.

Returns
*
push()method 
public function push(name:*, value:*):int

Adds one or more elements to the end of an ordered dictionary and returns the new length of the array.

Parameters
name:* — The key identifier.
 
value:* — The value to store.

Returns
int
shift()method 
public function shift():*

Removes the first element from an ordered dictionary and returns that element.

Returns
*
splice()method 
public function splice(startIndex:int, deleteCount:int):OrderedDictionary

Remove multiple items from the ordered dictionary.

Parameters
startIndex:int — The start index to delete from.
 
deleteCount:int — The number of items to delete.

Returns
OrderedDictionary
spliceByKeys()method 
public function spliceByKeys(... keys):OrderedDictionary

Remove objects by multiple keys.

Parameters
... keys — The keys to delete.

Returns
OrderedDictionary
unshift()method 
public function unshift(name:*, value:*):int

Adds one or more elements to the beginning of an ordered dictionary and returns the new length of the array.

Parameters
name:* — The key name.
 
value:* — The value to store.

Returns
int