-
Notifications
You must be signed in to change notification settings - Fork 1
HashMap
Jump To | Go Back |
Methods | Variables |
---|
Implements: Struct
Creates a hash table-type structure. Can be used a garbage-collected replacement for ds_map.
Jump To | top |
set | unset | lookup | lookup_by_array | key_exists | keys_to_array | from_JSON | to_JSON | clear | is_empty | size |
---|
Returns: self
Throws: InvalidArgumentType
Name | Type | Purpose |
---|---|---|
key | string |
The key used to look up the value |
value | mixed |
The value to assign to the key |
Sets the given key in the dictionary to the provided value. If the key is not a string, InvalidArgumentType will be thrown.
Returns: self
Throws: InvalidArgumentType, ValueNotFound
Name | Type | Purpose |
---|---|---|
key | string |
The key to remove |
Removes the given key from the dictionary. If the key didn't exist, ValueNotFound will be thrown. If the key was not a string, InvalidArgumentType is thrown.
Returns: mixed
Throws: InvalidArgumentType, ValueNotFound
Name | Type | Purpose |
---|---|---|
key | string |
The key to look up |
Looks up the given key in the dictionary and returns its value. If the key is not a string, InvalidArgumentType is thrown. If the value does not exist, ValueNotFound will be thrown.
Returns: array
Throws: InvalidArgumentType, ValueNotFound
Name | Type | Purpose |
---|---|---|
order | array |
The array of keys to return |
Looks up each key in the provided order and returns the resulting array. If the key is not a string InvalidArgumentType will be thrown, and if the value does not exist, ValueNotFound will be thrown.
Returns: bool
Throws: InvalidArgumentType
Name | Type | Purpose |
---|---|---|
key | string |
No description |
Returns true if the specified key exists in the dictionary. If the key is not a string InvalidArgumentType will be thrown.
Returns: array
Name | Type | Purpose |
---|---|---|
None |
Returns the keys in the dictionary formatted as an array.
Returns: self
Throws: InvalidArgumentType, UnexpectedTypeMismatch
Name | Type | Purpose |
---|---|---|
JSON_string | string |
The string to convert into a dictionary |
Takes the provided string and uses it to populate the dictionary. If a string is not provided, InvalidArgumentType is thrown. If the string does not convert into a dictionary UnexpectedTypeMismatch will be thrown.
Returns: string
Name | Type | Purpose |
---|---|---|
None |
Returns this dictionary as a JSON string.
Name | Type | Purpose |
---|---|---|
None |
Empties the hash table
Returns: int
Name | Type | Purpose |
---|---|---|
None |
Returns true if this dictionary contains no keys.
Returns: mixed
Name | Type | Purpose |
---|---|---|
None |
Returns the number of entries in the dictionary.
Jump To | top |
---|
Name | Type | Initial | Purpose |
---|---|---|---|
__Content | struct |
{} | The internal struct which holds the key/value pairs. |
Devon Mullane 2020