LisaacTM Platform

HASHED_DICTIONARY


Associative memory.Values of type `V' are stored using Keys of type `K'.
Efficient implementation of DICTIONARY using `hash_code' on keys.
Inherit/Insert Summary
parent_simple_dictionary No developed.
 
Constructor Summary
create
 
Slot Summary
buckets
The buckets storage area is the primary hash table of capacity elements. To search some key, the first access is done in buckets using the remainder of the division of the key hash_code by capacity. In order to try to avoid clashes, capacity is always a prime number (selected using HASH_TABLE_SIZE).
default_size
Default size for the storage area in number of items.
capacity
Of the buckets storage area. Approximation of the actual internal storage capacity. The capacity will grow automatically when needed (i.e. capacity is not a limit for the number of values stored). Also note that the capacity value may not be always accurate depending of the implementation (anyway, this capacity value is at least equals to count).
count
Actual count of stored elements. Actual count of stored elements. Number of available indices.
See also is_empty, lower, upper.
put to
Change some existing entry or add the new one. If there is as yet no key k in the dictionary, enter it with item v. Otherwise overwrite the item associated with key k. Change some existing entry or add the new one. If there is as yet no key k in the dictionary, enter it with item v. Otherwise overwrite the item associated with key k. As the put procedure actually uses is_equal, you may consider to use fast_put for expanded objects as well while trying to get the very best performances.
See also fast_put, add.
put to with
Change some existing entry or add the new one. If there is as yet no key k in the dictionary, enter it with item v. Otherwise overwrite the item associated with key k.
fast_put to
Change some existing entry or add the new one. If there is as yet no key k in the dictionary, enter it with item v. Otherwise overwrite the item associated with key k. Same job as put, but uses basic = for comparison.
See also put, add.
add to
To add a new entry k with its associated value v. Actually, this is equivalent to call put, but may run a little bit faster. To add a new entry k with its associated value v. Actually, this is equivalent to call put, but it may run a little bit faster.
See also put, fast_put.
make
Create an empty dictionary. Internal storage capacity of the dictionary is initialized using the Default_size value. Then, tuning of needed storage capacity is performed automatically according to usage. if you are really sure that your dictionary is always really bigger than Default_size, you may consider to use with_capacity to save some execution time. Creates an empty dictionary.
with_capacity
May be used to save some execution time if one is sure that storage size will rapidly become really bigger than Default_size. When first remove occurs, storage size may naturally become smaller than medium_size. Afterall, tuning of storage size is done automatically according to usage.
 
Basic access:
has
Is there a value currently associated with key k? Is there a value currently associated with key k?
See also fast_has, at.
at
Return the value associated to key k. (See also reference_at if V is a reference type.) Return the value associated to key k.
See also fast_at, reference_at, has.
reference_at
Return NULL or the value associated with key k. Actually, this feature is useful when the type of values (the type E) is a reference type, to avoid using has just followed by at to get the corresponding value. Return NULL or the value associated with key k. Actually, this feature is useful when the type of values (the type V) is a reference type, to avoid using has just followed by at to get the corresponding value.
See also fast_reference_at, at, has.
reference_at with
Return NULL or the value associated with key k. Actually, this feature is useful when the type of values (the type E) is a reference type, to avoid using has just followed by at to get the corresponding value.
fast_has
Is there a value currently associated with key k? Using basic = for comparison.
See also has, at, fast_at.
fast_at
Return the value associated to key k using basic = for comparison.
See also at, reference_at, fast_reference_at.
fast_reference_at
Return NULL or the value associated with key k. Actually, this feature is useful when the type of values (the type V) is a reference type, to avoid using has just followed by at to get the corresponding value. Same work as reference_at, but basic = is used for comparison.
See also reference_at, at, has.
 
Removing:
remove
Remove entry k (which may exist or not before this call). Remove entry k (which may exist or not before this call). As the remove procedure actually uses is_equal, you may consider to use fast_remove for expanded objects as well while trying to get the very best performances.
See also fast_remove, clear_count.
fast_remove
Same job as remove, but uses basic = for comparison.
See also remove, clear_count.
clear
Discard all items.
 
To provide iterating facilities:
item
Item at the corresponding index i.
See also lower, upper, valid_index.
key
key_map_in
Append in buffer, all available keys (this may be useful to speed up the traversal). Append in buffer, all available keys (this may be useful to speed up the traversal).
See also item_map_in.
item_map_in
Append in buffer, all available items (this may be useful to speed up the traversal). Append in buffer, all available items (this may be useful to speed up the traversal).
See also key_map_in.
copy
Reinitialize by copying all associations of other. Reinitialize by copying all associations of other.
 
Other features:
internal_key
Retrieve the internal key object which correspond to the existing entry k (the one memorized into the self dictionary). Retrieve the internal key object which correspond to the existing entry k (the one memorized into the Current dictionary).
See also has, fast_has.
 

Inherit/Insert Detail

parent_simple_dictionary

.../base/collection/hashed_dictionary.li line #15

Section:
Inherit

Profile:
- SelfSELFparent_simple_dictionary :Expanded  SIMPLE_DICTIONARYVK)

Constructor Detail

create

.../base/collection/hashed_dictionary.li line #528

Section:
Public

Profile:
- SelfSELFcreate : SELF

Detail slot

buckets

.../base/collection/hashed_dictionary.li line #20

Section:
Public

Profile:
+ SelfSELFbuckets : NATIVE_ARRAYHASHED_DICTIONARY_NODEVK))

Description:
The buckets storage area is the primary hash table of capacity elements. To search some key, the first access is done in buckets using the remainder of the division of the key hash_code by capacity. In order to try to avoid clashes, capacity is always a prime number (selected using HASH_TABLE_SIZE).

default_size

.../base/collection/hashed_dictionary.li line #29

Section:
Public

Profile:
- SelfSELFdefault_size : INTEGER

Description:
Default size for the storage area in number of items.

capacity

.../base/collection/hashed_dictionary.li line #34

Section:
Public

Profile:
+ SelfSELFcapacity : INTEGER

Description:
Of the buckets storage area. Approximation of the actual internal storage capacity. The capacity will grow automatically when needed (i.e. capacity is not a limit for the number of values stored). Also note that the capacity value may not be always accurate depending of the implementation (anyway, this capacity value is at least equals to count).

count

.../base/collection/hashed_dictionary.li line #37

Section:
Public

Profile:
+ SelfSELFcount : INTEGER

Description:
Actual count of stored elements. Actual count of stored elements. Number of available indices.
See also is_empty, lower, upper.

put to

.../base/collection/hashed_dictionary.li line #157

Section:
Public

Profile:
- SelfSELFput   v : V  to   k : K

Description:
Change some existing entry or add the new one. If there is as yet no key k in the dictionary, enter it with item v. Otherwise overwrite the item associated with key k. Change some existing entry or add the new one. If there is as yet no key k in the dictionary, enter it with item v. Otherwise overwrite the item associated with key k. As the put procedure actually uses is_equal, you may consider to use fast_put for expanded objects as well while trying to get the very best performances.
See also fast_put, add.

put to with

.../base/collection/hashed_dictionary.li line #185

Section:
Public

Profile:
- SelfSELFput   v : V  to   k : K  with   cmp :{KK);  BOOLEAN}

Description:
Change some existing entry or add the new one. If there is as yet no key k in the dictionary, enter it with item v. Otherwise overwrite the item associated with key k.

fast_put to

.../base/collection/hashed_dictionary.li line #213

Section:
Public

Profile:
- SelfSELFfast_put   v : V  to   k : K

Description:
Change some existing entry or add the new one. If there is as yet no key k in the dictionary, enter it with item v. Otherwise overwrite the item associated with key k. Same job as put, but uses basic = for comparison.
See also put, add.

add to

.../base/collection/hashed_dictionary.li line #241

Section:
Public

Profile:
- SelfSELFadd   v : V  to   k : K

Description:
To add a new entry k with its associated value v. Actually, this is equivalent to call put, but may run a little bit faster. To add a new entry k with its associated value v. Actually, this is equivalent to call put, but it may run a little bit faster.
See also put, fast_put.

make

.../base/collection/hashed_dictionary.li line #535

Section:
Public

Profile:
- SelfSELFmake 

Description:
Create an empty dictionary. Internal storage capacity of the dictionary is initialized using the Default_size value. Then, tuning of needed storage capacity is performed automatically according to usage. if you are really sure that your dictionary is always really bigger than Default_size, you may consider to use with_capacity to save some execution time. Creates an empty dictionary.

with_capacity

.../base/collection/hashed_dictionary.li line #549

Section:
Public

Profile:
- SelfSELFwith_capacity   medium_size : INTEGER

Description:
May be used to save some execution time if one is sure that storage size will rapidly become really bigger than Default_size. When first remove occurs, storage size may naturally become smaller than medium_size. Afterall, tuning of storage size is done automatically according to usage.

Basic access:

has

.../base/collection/hashed_dictionary.li line #44

Section:
Public

Profile:
- SelfSELFhas   k : KBOOLEAN

Description:
Is there a value currently associated with key k? Is there a value currently associated with key k?
See also fast_has, at.

at

.../base/collection/hashed_dictionary.li line #57

Section:
Public

Profile:
- SelfSELFat   k : KV

Description:
Return the value associated to key k. (See also reference_at if V is a reference type.) Return the value associated to key k.
See also fast_at, reference_at, has.

reference_at

.../base/collection/hashed_dictionary.li line #71

Section:
Public

Profile:
- SelfSELFreference_at   k : KV

Description:
Return NULL or the value associated with key k. Actually, this feature is useful when the type of values (the type E) is a reference type, to avoid using has just followed by at to get the corresponding value. Return NULL or the value associated with key k. Actually, this feature is useful when the type of values (the type V) is a reference type, to avoid using has just followed by at to get the corresponding value.
See also fast_reference_at, at, has.

reference_at with

.../base/collection/hashed_dictionary.li line #91

Section:
Public

Profile:
- SelfSELFreference_at   k : K  with   cmp :{KK);  BOOLEAN}V

Description:
Return NULL or the value associated with key k. Actually, this feature is useful when the type of values (the type E) is a reference type, to avoid using has just followed by at to get the corresponding value.

fast_has

.../base/collection/hashed_dictionary.li line #111

Section:
Public

Profile:
- SelfSELFfast_has   k : KBOOLEAN

Description:
Is there a value currently associated with key k? Using basic = for comparison.
See also has, at, fast_at.

fast_at

.../base/collection/hashed_dictionary.li line #123

Section:
Public

Profile:
- SelfSELFfast_at   k : KV

Description:
Return the value associated to key k using basic = for comparison.
See also at, reference_at, fast_reference_at.

fast_reference_at

.../base/collection/hashed_dictionary.li line #135

Section:
Public

Profile:
- SelfSELFfast_reference_at   k : KV

Description:
Return NULL or the value associated with key k. Actually, this feature is useful when the type of values (the type V) is a reference type, to avoid using has just followed by at to get the corresponding value. Same work as reference_at, but basic = is used for comparison.
See also reference_at, at, has.

Removing:

remove

.../base/collection/hashed_dictionary.li line #261

Section:
Public

Profile:
- SelfSELFremove   k : K

Description:
Remove entry k (which may exist or not before this call). Remove entry k (which may exist or not before this call). As the remove procedure actually uses is_equal, you may consider to use fast_remove for expanded objects as well while trying to get the very best performances.
See also fast_remove, clear_count.

fast_remove

.../base/collection/hashed_dictionary.li line #290

Section:
Public

Profile:
- SelfSELFfast_remove   k : K

Description:
Same job as remove, but uses basic = for comparison.
See also remove, clear_count.

clear

.../base/collection/hashed_dictionary.li line #318

Section:
Public

Profile:
- SelfSELFclear 

Description:
Discard all items.

To provide iterating facilities:

item

.../base/collection/hashed_dictionary.li line #333

Section:
Public

Profile:
- SelfSELFitem   i : INTEGERV

Description:
Item at the corresponding index i.
See also lower, upper, valid_index.

key

.../base/collection/hashed_dictionary.li line #339

Section:
Public

Profile:
- SelfSELFkey   index : INTEGERK

key_map_in

.../base/collection/hashed_dictionary.li line #345

Section:
Public

Profile:
- SelfSELFkey_map_in   buffer : COLLECTIONK)

Description:
Append in buffer, all available keys (this may be useful to speed up the traversal). Append in buffer, all available keys (this may be useful to speed up the traversal).
See also item_map_in.

item_map_in

.../base/collection/hashed_dictionary.li line #363

Section:
Public

Profile:
- SelfSELFitem_map_in   buffer : COLLECTIONV)

Description:
Append in buffer, all available items (this may be useful to speed up the traversal). Append in buffer, all available items (this may be useful to speed up the traversal).
See also key_map_in.

copy

.../base/collection/hashed_dictionary.li line #381

Section:
Public

Profile:
- SelfSELFcopy   other : SELF

Description:
Reinitialize by copying all associations of other. Reinitialize by copying all associations of other.

Other features:

internal_key

.../base/collection/hashed_dictionary.li line #400

Section:
Public

Profile:
- SelfSELFinternal_key   k : KK

Description:
Retrieve the internal key object which correspond to the existing entry k (the one memorized into the self dictionary). Retrieve the internal key object which correspond to the existing entry k (the one memorized into the Current dictionary).
See also has, fast_has.