Copyright © 2011 Erlware, LLC.
Behaviours: ec_dictionary.
Authors: Eric Merritt (ericbmerritt@gmail.com).
add/3 | add a new value to the existing dictionary. |
from_list/1 | |
get/2 | given a key return that key from the dictionary. |
get/3 | |
has_key/2 | check to see if the dictionary provided has the specified key. |
has_value/2 | Check to see if the value exists in the dictionary. |
keys/1 | |
new/0 | create a new dictionary object from the specified module. |
remove/2 | Remove a value from the dictionary returning a new dictionary with the value removed. |
size/1 | return the current number of key value pairs in the dictionary. |
to_list/1 |
add(Key::ec_dictionary:key(K), Value::ec_dictionary:value(V), Object::gb_trees:tree(K, V)) -> gb_trees:tree(K, V)
Key: the key to add
Value: the value to add
Object: the dictionary object to add too
add a new value to the existing dictionary. Return a new dictionary containing the value.
from_list(List::[{ec_dictionary:key(K), ec_dictionary:value(V)}]) -> gb_trees:tree(K, V)
get(Key::ec_dictionary:key(K), Object::gb_trees:tree(K, V)) -> ec_dictionary:value(V)
Key: The key requested
when the key does not exist @throws not_found
Object: The dictionary object to return the value from
given a key return that key from the dictionary. If the key is not found throw a 'not_found' exception.
get(Key::ec_dictionary:key(K), Default::ec_dictionary:value(V), Object::gb_trees:tree(K, V)) -> ec_dictionary:value(V)
has_key(Key::ec_dictionary:key(K), Object::gb_trees:tree(K, _V)) -> boolean()
Key: The key to check the dictionary for
Object: The dictory object to check
check to see if the dictionary provided has the specified key.
has_value(Value::ec_dictionary:value(V), Object::gb_trees:tree(_K, V)) -> boolean()
Value: The value to check if exists
Object: the dictionary object to check
Check to see if the value exists in the dictionary
keys(Data::gb_trees:tree(K, _V)) -> [ec_dictionary:key(K)]
new() -> gb_trees:tree(_K, _V)
create a new dictionary object from the specified module. The module should implement the dictionary behaviour. In the clause where an existing object is passed in new empty dictionary of the same implementation is created and returned.
remove(Key::ec_dictionary:key(K), Object::gb_trees:tree(K, V)) -> gb_trees:tree(K, V)
Key: the key of the key/value pair to remove
Object: the dictionary object to remove the value from
Remove a value from the dictionary returning a new dictionary with the value removed.
size(Object::gb_trees:tree(_K, _V)) -> non_neg_integer()
Object: the object return the size for.
return the current number of key value pairs in the dictionary
to_list(Data::gb_trees:tree(K, V)) -> [{ec_dictionary:key(K), ec_dictionary:value(V)}]
Generated by EDoc, Feb 15 2022, 15:17:47.