Dictionary

Dictionary

new Dictionary()

Source:
. Create a Dictionary Object. Out Type can be replaced with [] in a var

Members

(readonly) Count

Source:
. Get the amount of items

Methods

(static) ToDictionary(obj)

Source:
. Generate a Dictionary from an Object using Key:Value Pairs
Parameters:
Name Type Description
obj Object

Add(Key, Value)

Source:
Add an entry to the Dictionary. Will Error if Key already exists.
Parameters:
Name Type Description
Key T Value.
Value A Value.

AddOrUpdate(key, value, funcopt) → {Boolean}

Source:
. Adds a new Value at Key. If Key exists, Updates Key. If func is set, Programatically updates Key
Parameters:
Name Type Attributes Description
key T
value A
func Dictionary.AddOrUpdate~callback <optional>
Returns:
Added
Type
Boolean

Clear()

Source:
. Clear the Dictionary

ContainsKey(Key) → {boolean}

Source:
. Check if a Key exists
Parameters:
Name Type Description
Key T
Returns:
- Key Found
Type
boolean

ContainsValue(Value) → {boolean}

Source:
. Check if a Value exists in the Dictionary
Parameters:
Name Type Description
Value A
Returns:
- Value Exists
Type
boolean

EnsureCapacity()

Source:
Deprecated:
  • Yes
. Get the Capacity

Get(key, out) → {boolean}

Source:
. Get a key's value
Parameters:
Name Type Description
key T Key
out Out.<A> Output Var
Returns:
- Key Exists
Type
boolean

Reduce(callbackfn, InitialValue) → {*}

Source:
. Reduce a Dictionary's values down
Parameters:
Name Type Description
callbackfn Dictionary.Reduce~callback Computation function
InitialValue * Initial Value
Returns:
Type
*

Remove(key) → {boolean}

Source:
. Remove a Key. Will error if Key does not exist
Parameters:
Name Type Description
key T
Returns:
- Key Removed
Type
boolean

RemoveAt(iIndex)

Source:
. Remove an Item at a given Index
Parameters:
Name Type Description
iIndex number

Replace(key, Value) → {boolean}

Source:
. Replace Key's value with new Value
Parameters:
Name Type Description
key T
Value A
Returns:
- Was replace successful
Type
boolean

TryAdd(Key, Value) → {Boolean}

Source:
. Attempt to add an entry to the Dictionary
Parameters:
Name Type Description
Key T
Value A
Returns:
- Was the Add command successfull
Type
Boolean

TryGetValue(value, out) → {boolean}

Source:
. Attempt to get Value, Sets Value to Out. Returns Boolean valueExists
Parameters:
Name Type Description
value A
out Out.<A>
Returns:
- Value Existed
Type
boolean

TryRemove(key) → {boolean}

Source:
Attempt to remove a Key.
Parameters:
Name Type Description
key T
Returns:
- Key Removed.
Type
boolean