+
Point of view
All features
class AVL_DICTIONARY [V_, K_ -> COMPARABLE]
Summary
Class invariant
Overview
creation features
  • make
    Creates an empty dictionary.
features
  • capacity: INTEGER_32
    Approximation of the actual internal storage capacity.
  • at (k: K_): V_
    Return the value associated to key k.
  • fast_at (k: K_): V_
    Return the value associated to key k using basic = for comparison.
  • reference_at (k: K_): V_
    Return Void or the value associated with key k.
  • fast_reference_at (k: K_): V_
    Same work as reference_at, but basic = is used for comparison.
  • put (v: V_, k: K_)
    Change some existing entry or add the new one.
  • add (v: V_, k: K_)
    To add a new entry k with its associated value v.
  • fast_put (v: V_, k: K_)
    Same job as put, but uses basic = for comparison.
  • occurrences (v: V_): INTEGER_32
    Number of occurrences using is_equal for comparison.
  • fast_occurrences (v: V_): INTEGER_32
    Number of occurrences using basic = for comparison.
  • key_at (v: V_): K_
    Retrieve the key used for value v using is_equal for comparison.
  • fast_key_at (v: V_): K_
    Retrieve the key used for value v using = for comparison.
  • clear_count
    Discard all items (is_empty is True after that call).
  • clear_count_and_capacity
    Discard all items (is_empty is True after that call).
  • item (index: INTEGER_32): V_
    Item at the corresponding index i.
  • key (index: INTEGER_32): K_
  • get_new_iterator_on_keys: ITERATOR[K_]
  • internal_key (k: K_): K_
    Retrieve the internal key object which correspond to the existing entry k (the one memorized into the Current dictionary).
  • copy (other: AVL_DICTIONARY [V_, K_ -> COMPARABLE])
    Reinitialize by copying all associations of other.
Counting:
Basic access:
  • has (k: K_): BOOLEAN
    Is there a value currently associated with key k?
  • infix "@" (k: K_): V_
    The infix notation which is actually a synonym for at.
  • fast_has (k: K_): BOOLEAN
    Is there a value currently associated with key k?
Removing:
  • remove (k: K_)
    Remove entry k (which may exist or not before this call).
  • fast_remove (k: K_)
    Same job as remove, but uses basic = for comparison.
To provide iterating facilities:
Agents based features:
Implement manifest generic creation:
Indexing:
Counting:
Other features:
Iterating internals:
capacity: INTEGER_32
effective function
Approximation of the actual internal storage capacity.
at (k: K_): V_
effective function
Return the value associated to key k.
fast_at (k: K_): V_
effective function
Return the value associated to key k using basic = for comparison.
reference_at (k: K_): V_
effective function
Return Void or the value associated with key k.
fast_reference_at (k: K_): V_
effective function
Same work as reference_at, but basic = is used for comparison.
put (v: V_, k: K_)
effective procedure
Change some existing entry or add the new one.
add (v: V_, k: K_)
effective procedure
To add a new entry k with its associated value v.
fast_put (v: V_, k: K_)
effective procedure
Same job as put, but uses basic = for comparison.
occurrences (v: V_): INTEGER_32
effective function
Number of occurrences using is_equal for comparison.
fast_occurrences (v: V_): INTEGER_32
effective function
Number of occurrences using basic = for comparison.
key_at (v: V_): K_
effective function
Retrieve the key used for value v using is_equal for comparison.
fast_key_at (v: V_): K_
effective function
Retrieve the key used for value v using = for comparison.
clear_count
effective procedure
Discard all items (is_empty is True after that call).
clear_count_and_capacity
effective procedure
Discard all items (is_empty is True after that call).
item (index: INTEGER_32): V_
effective function
Item at the corresponding index i.
key (index: INTEGER_32): K_
effective function
get_new_iterator_on_keys: ITERATOR[K_]
effective function
internal_key (k: K_): K_
effective function
Retrieve the internal key object which correspond to the existing entry k (the one memorized into the Current dictionary).
copy (other: AVL_DICTIONARY [V_, K_ -> COMPARABLE])
effective procedure
Reinitialize by copying all associations of other.
value_memory: V_
writable attribute
set_value_and_key (n: AVL_DICTIONARY_NODE[V_, K_])
effective procedure
set_value (n: AVL_DICTIONARY_NODE[V_, K_])
effective procedure
exchange_and_discard (n1: AVL_DICTIONARY_NODE[V_, K_], n2: AVL_DICTIONARY_NODE[V_, K_])
effective procedure
discard_node (n: AVL_DICTIONARY_NODE[V_, K_])
effective procedure
once function
a_new_node: AVL_DICTIONARY_NODE[V_, K_]
effective function
make
effective procedure
Creates an empty dictionary.
is_empty: BOOLEAN
effective function
Is it empty?
has (k: K_): BOOLEAN
deferred function
Is there a value currently associated with key k?
infix "@" (k: K_): V_
frozen
effective function
The infix notation which is actually a synonym for at.
fast_has (k: K_): BOOLEAN
deferred function
Is there a value currently associated with key k?
remove (k: K_)
deferred procedure
Remove entry k (which may exist or not before this call).
fast_remove (k: K_)
deferred procedure
Same job as remove, but uses basic = for comparison.
lower: INTEGER_32
constant attribute
Minimum index.
upper: INTEGER_32
effective function
Maximum index.
first: V_
effective function
The very first item.
last: V_
effective function
The last item.
get_new_iterator_on_items: ITERATOR[V_]
effective function
key_map_in (buffer: COLLECTION[K_])
effective procedure
Append in buffer, all available keys (this may be useful to speed up the traversal).
item_map_in (buffer: COLLECTION[V_])
effective procedure
Append in buffer, all available items (this may be useful to speed up the traversal).
is_equal (other: AVL_DICTIONARY [V_, K_ -> COMPARABLE]): BOOLEAN
effective function
Do both dictionaries have the same set of associations?
is_equal_map (other: AVL_DICTIONARY [V_, K_ -> COMPARABLE]): BOOLEAN
effective function
Do both dictionaries have the same set of associations?
do_all (action: ROUTINE[TUPLE[TUPLE 2[V_, K_]]])
effective procedure
Apply action to every [V_, K_] associations of Current.
for_all (test: FUNCTION[TUPLE[TUPLE 2[V_, K_]]]): BOOLEAN
effective function
Do all [V_, K_] associations satisfy test?
exists (test: FUNCTION[TUPLE[TUPLE 2[V_, K_]]]): BOOLEAN
effective function
Does at least one [V_, K_] association satisfy test?
manifest_make (needed_capacity: INTEGER_32)
effective procedure
Manifest creation of a dictionary.
manifest_put (index: INTEGER_32, v: V_, k: K_)
effective procedure
manifest_semicolon_check: INTEGER_32
constant attribute
Put semicolons between successive value-key pairs.
key_safe_equal (k1: K_, k2: K_): BOOLEAN
effective function
Because keys are never Void, we do not rely on the SAFE_EQUAL class.
valid_index (i: INTEGER_32): BOOLEAN
effective function
True when i is valid (i.e., inside actual bounds).
count: INTEGER_32
deferred function
Number of available indices.
get_new_iterator: ITERATOR[E_]
deferred function
debug_string: STRING
effective function
root: AVL_TREE_NODE[E_]
writable attribute
rebalance: BOOLEAN
writable attribute
item_memory: E_
writable attribute
fast_do_insert (n: AVL_TREE_NODE[E_]): AVL_TREE_NODE[E_]
effective function
do_insert (n: AVL_TREE_NODE[E_]): AVL_TREE_NODE[E_]
effective function
left_grown (n: AVL_TREE_NODE[E_]): AVL_TREE_NODE[E_]
effective function
right_grown (n: AVL_TREE_NODE[E_]): AVL_TREE_NODE[E_]
effective function
fast_do_remove (n: AVL_TREE_NODE[E_], e: E_): AVL_TREE_NODE[E_]
effective function
do_remove (n: AVL_TREE_NODE[E_], e: E_): AVL_TREE_NODE[E_]
effective function
remove_right (n1: AVL_TREE_NODE[E_], n2: AVL_TREE_NODE[E_]): AVL_TREE_NODE[E_]
effective function
left_shrunk (n: AVL_TREE_NODE[E_]): AVL_TREE_NODE[E_]
effective function
right_shrunk (n: AVL_TREE_NODE[E_]): AVL_TREE_NODE[E_]
effective function
clear_nodes (node: AVL_TREE_NODE[E_])
effective procedure
node_height (node: AVL_TREE_NODE[E_]): INTEGER_32
effective function
build_map
effective procedure
writable attribute
Elements in a row for iteration.
map_dirty: BOOLEAN
writable attribute
True when the map needs to be built again for the iterators.
new_node: AVL_TREE_NODE[E_]
effective function
lost_nodes: WEAK_REFERENCE[AVL_TREE_NODE[E_]]
writable attribute
balanced: INTEGER_32
constant attribute
imbalanced_left: INTEGER_32
constant attribute
imbalanced_right: INTEGER_32
constant attribute