+
Point of view
All features
class AVL_SET [E_ -> COMPARABLE]
Summary
Class invariant
Overview
creation features
features
  • add (e: E_)
    Add new item e to the set.
  • fast_add (e: E_)
    Same job as add, but uses basic = for comparison.
  • clear_count
    Empty the current set (is_empty is True after that call).
  • clear_count_and_capacity
    Empty the current set (is_empty is True after that call).
  • reference_at (e: E_): E_
    Non Void when e is in the set.
  • item (index: INTEGER_32): E_
    Item at the corresponding index i.
Counting:
Adding and removing:
  • remove (e: E_)
    Remove item e from the set: the mathematical definition of removing from a set is followed.
  • fast_remove (e: E_)
    Same job as remove, but uses basic = for comparison.
Looking and searching:
To provide iterating facilities:
Mathematical operations:
Comparison:
Agents based features:
Implement manifest generic creation:
Indexing:
Counting:
  • test (e1: E_, e2: E_): BOOLEAN
    In order to avoid run-time type errors, feature safe_equal calls is_equal only when e1 and e2 have exactly the same dynamic type.
  • safe_equal (e1: E_, e2: E_): BOOLEAN
    In order to avoid run-time type errors, feature safe_equal calls is_equal only when e1 and e2 have exactly the same dynamic type.
Iterating internals:
add (e: E_)
effective procedure
Add new item e to the set.
fast_add (e: E_)
effective procedure
Same job as add, but uses basic = for comparison.
clear_count
effective procedure
Empty the current set (is_empty is True after that call).
clear_count_and_capacity
effective procedure
Empty the current set (is_empty is True after that call).
reference_at (e: E_): E_
effective function
Non Void when e is in the set.
item (index: INTEGER_32): E_
effective function
Item at the corresponding index i.
set_item (n: AVL_SET_NODE[E_])
effective procedure
set_value (n: AVL_SET_NODE[E_])
effective procedure
exchange_and_discard (n1: AVL_SET_NODE[E_], n2: AVL_SET_NODE[E_])
effective procedure
discard_node (n: AVL_SET_NODE[E_])
effective procedure
a_new_node: AVL_SET_NODE[E_]
effective function
once function
make
effective procedure
Creation of an empty SET.
is_empty: BOOLEAN
effective function
Is the set empty?
remove (e: E_)
deferred procedure
Remove item e from the set: the mathematical definition of removing from a set is followed.
fast_remove (e: E_)
deferred procedure
Same job as remove, but uses basic = for comparison.
has (e: E_): BOOLEAN
deferred function
Is element e in the set?
fast_has (e: E_): BOOLEAN
deferred function
Is element e actually stored in the set?
lower: INTEGER_32
constant attribute
Minimum index.
upper: INTEGER_32
effective function
Maximum index.
first: E_
effective function
The very first item.
last: E_
effective function
The last item.
get_new_iterator: ITERATOR[E_]
effective function
union (other: AVL_SET [E_ -> COMPARABLE])
effective procedure
Make the union of the Current set with other.
infix "+" (other: AVL_SET [E_ -> COMPARABLE]): AVL_SET [E_ -> COMPARABLE]
effective function
Return the union of the Current set with other.
intersection (other: AVL_SET [E_ -> COMPARABLE])
effective procedure
Make the intersection of the Current set with other.
infix "^" (other: AVL_SET [E_ -> COMPARABLE]): AVL_SET [E_ -> COMPARABLE]
effective function
Return the intersection of the Current set with other.
minus (other: AVL_SET [E_ -> COMPARABLE])
effective procedure
Make the set Current - other.
infix "-" (other: AVL_SET [E_ -> COMPARABLE]): AVL_SET [E_ -> COMPARABLE]
effective function
Return the set Current - other.
is_subset_of (other: AVL_SET [E_ -> COMPARABLE]): BOOLEAN
effective function
Is the Current set a subset of other?
is_disjoint_from (other: AVL_SET [E_ -> COMPARABLE]): BOOLEAN
effective function
Is the Current set disjoint from other ?
is_equal (other: AVL_SET [E_ -> COMPARABLE]): BOOLEAN
effective function
Is the Current set equal to other?
copy (other: AVL_SET [E_ -> COMPARABLE])
effective procedure
Copy 'other' into the current set
from_collection (model: COLLECTION[E_])
effective procedure
Add all items of model.
do_all (action: ROUTINE[TUPLE[TUPLE 1[E_]]])
effective procedure
Apply action to every item of Current.
for_all (predicate: FUNCTION[TUPLE[TUPLE 1[E_]]]): BOOLEAN
effective function
Do all items satisfy predicate?
exists (predicate: FUNCTION[TUPLE[TUPLE 1[E_]]]): BOOLEAN
effective function
Does at least one item satisfy predicate?
manifest_make (needed_capacity: INTEGER_32)
effective procedure
Manifest creation of a SET.
manifest_put (index: INTEGER_32, element: E_)
effective procedure
manifest_semicolon_check: BOOLEAN
constant attribute
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.
test (e1: E_, e2: E_): BOOLEAN
effective function
In order to avoid run-time type errors, feature safe_equal calls is_equal only when e1 and e2 have exactly the same dynamic type.
safe_equal (e1: E_, e2: E_): BOOLEAN
effective function
In order to avoid run-time type errors, feature safe_equal calls is_equal only when e1 and e2 have exactly the same dynamic type.
debug_string: STRING
effective function
root: AVL_TREE_NODE[E_]
writable attribute
rebalance: BOOLEAN
writable attribute
item_memory: E_
writable attribute
set_value_and_key (n: AVL_TREE_NODE[E_])
deferred procedure
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