Dictionary(Object)

Dictionary is a collection of key and value pairs. Dictionary values can be referenced with an indexer syntax [“key”]. Note, Dictionary is not as robust as C#’s dictionary but they serve similar purposes.

Constructors

Dictionary() Creates a new dictionary.

Fields

Type Type Returns Type.Dictionary

Functions

Add(String key, Object value) undefined Adds a key/value pair with the provided key and value.
Add(Number key, Object value) undefined Adds a key/value pair with the provided key and value.
Clear() undefined Clears the dictionary of all key/value pairs.
ContainsKey(String key) Boolean Returns whether the dictionary contains the provided key.
ContainsKey(Number key) Boolean Returns whether the dictionary contains the provided key.
ContainsValue(Object obj) Boolean Returns whether the dictionary contains the value.
Copy() Dictionary Returns a copy of the dictionary.
Count() Number Returns the number of entries in the dictionary.
ForEach(Function func) Dictionary Loops through all key/value pairs and calls the provided function passing in KeyValuePairs in parameter and a second parameter of the type IterationEventArgs.
GetValue(String key) Object Returns the value associated with the provided key.
GetValue(Number key) Object Returns the value associated with the provided key.
Keys() Array Returns an array of all the keys.
Remove(String key) undefined Removes the key and the value associated with the key.
Remove(Number key) undefined Removes the key and the value associated with the key.
SetValue(String key, Object value) undefined Sets the existing key the provided value, if it exists, otherwise a new key/value pair is added.
SetValue(Number key, Object value) undefined Sets the existing key the provided value, if it exists, otherwise a new key/value pair is added.
Values() Array Returns an array of all existing values in the dictionary.

Last edited May 29, 2011 at 9:34 PM by dahrkdaiz, version 3

Comments

No comments yet.