+
Point of view
All features
class EXT_AVL_SET [E_]
Summary
Direct parents
Inherit list: ABSTRACT_AVL_SET
Class invariant
• order /= Void
• map /= Void
• not map_dirty implies map.count = count
• count > 0 implies root /= Void and then root.count = count
• lost_nodes /= Void
Overview
Creation features
{ANY}
Features
{ANY}
{}
{ANY}
{}
Counting:
{ANY}
{ANY}
• 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:
{ANY}
To provide iterating facilities:
{ANY}
Mathematical operations:
{ANY}
• union (other: EXT_AVL_SET [E_])
Make the union of the Current set with other.
• fast_union (other: EXT_AVL_SET [E_])
Make the union of the Current set with other.
• infix "+" (other: EXT_AVL_SET [E_]): EXT_AVL_SET [E_]
Return the union of the Current set with other.
• intersection (other: EXT_AVL_SET [E_])
Make the intersection of the Current set with other.
• fast_intersection (other: EXT_AVL_SET [E_])
Make the intersection of the Current set with other.
• infix "^" (other: EXT_AVL_SET [E_]): EXT_AVL_SET [E_]
Return the intersection of the Current set with other.
• minus (other: EXT_AVL_SET [E_])
Make the set Current - other.
• fast_minus (other: EXT_AVL_SET [E_])
Make the set Current - other.
• infix "-" (other: EXT_AVL_SET [E_]): EXT_AVL_SET [E_]
Return the set Current - other.
Comparison:
{ANY}
{ANY}
• copy (other: EXT_AVL_SET [E_])
Copy 'other' into the current set
Implement manifest generic creation:
{}
{ANY}
Other features:
{ANY}
Agent-based features:
{ANY}
Printing:
{ANY}
{ANY}
{}
Counting:
{ANY}
Agent-based features:
{ANY}
{}
Indexing:
{ANY}
{ANY}
• 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.
{ANY}
{}
Iterating internals:
{}
• build_map
• map: FAST_ARRAY[AVL_TREE_NODE[E_]]
Elements in a row for iteration.
• map_dirty: BOOLEAN
True when the map needs to be built again for the iterators.
{}
{}
order: FUNCTION[TUPLE[TUPLE 2[E_, E_]]]
writable attribute
{ANY}
from_collection (a_order: FUNCTION[TUPLE[TUPLE 2[E_, E_]]], model: COLLECTION[ANY])
effective procedure
{ANY}
ordered (e1: E_, e2: E_): BOOLEAN
effective function
{}
True if [e1, e2] is a correctly ordered sequence; usually, e1 < e2
a_new_node: EXT_AVL_SET_NODE[E_]
effective function
{}
make (a_order: FUNCTION[TUPLE[TUPLE 2[E_, E_]]])
effective procedure
{}
new_iterator: ITERATOR[E_]
effective function
{ANY}
effective procedure
{ANY}
Add new item e to the set.
effective procedure
{ANY}
Same job as add, but uses basic = for comparison.
clear_count
effective procedure
{ANY}
Empty the current set (is_empty is True after that call).
clear_count_and_capacity
effective procedure
{ANY}
Empty the current set (is_empty is True after that call).
reference_at (e: E_): E_
effective function
{ANY}
Non Void when e is in the set.
item (index: INTEGER_32): E_
effective function
{ANY}
Item at the corresponding index i.
set_item (n: ABSTRACT_AVL_SET_NODE[E_])
effective procedure
{}
set_value (n: ABSTRACT_AVL_SET_NODE[E_])
effective procedure
{}
effective procedure
{}
is_empty: BOOLEAN
effective function
{ANY}
Is the set empty?
remove (e: E_)
deferred procedure
{ANY}
Remove item e from the set: the mathematical definition of removing from a set is followed.
fast_remove (e: E_)
deferred procedure
{ANY}
Same job as remove, but uses basic = for comparison.
has (e: E_): BOOLEAN
deferred function
{ANY}
Is element e in the set?
fast_has (e: E_): BOOLEAN
deferred function
{ANY}
Is element e actually stored in the set?
lower: INTEGER_32
is 1
constant attribute
{ANY}
Minimum index.
upper: INTEGER_32
effective function
{ANY}
Maximum index.
first: E_
effective function
{ANY}
The very first item.
last: E_
effective function
{ANY}
The last item.
union (other: EXT_AVL_SET [E_])
effective procedure
{ANY}
Make the union of the Current set with other.
fast_union (other: EXT_AVL_SET [E_])
effective procedure
{ANY}
Make the union of the Current set with other.
infix "+" (other: EXT_AVL_SET [E_]): EXT_AVL_SET [E_]
effective function
{ANY}
Return the union of the Current set with other.
intersection (other: EXT_AVL_SET [E_])
effective procedure
{ANY}
Make the intersection of the Current set with other.
fast_intersection (other: EXT_AVL_SET [E_])
effective procedure
{ANY}
Make the intersection of the Current set with other.
infix "^" (other: EXT_AVL_SET [E_]): EXT_AVL_SET [E_]
effective function
{ANY}
Return the intersection of the Current set with other.
minus (other: EXT_AVL_SET [E_])
effective procedure
{ANY}
Make the set Current - other.
fast_minus (other: EXT_AVL_SET [E_])
effective procedure
{ANY}
Make the set Current - other.
infix "-" (other: EXT_AVL_SET [E_]): EXT_AVL_SET [E_]
effective function
{ANY}
Return the set Current - other.
is_subset_of (other: EXT_AVL_SET [E_]): BOOLEAN
effective function
{ANY}
Is the Current set a subset of other?
is_disjoint_from (other: EXT_AVL_SET [E_]): BOOLEAN
effective function
{ANY}
Is the Current set disjoint from other ?
is_equal (other: EXT_AVL_SET [E_]): BOOLEAN
effective function
{ANY}
Is the Current set equal to other?
copy (other: EXT_AVL_SET [E_])
effective procedure
{ANY}
Copy 'other' into the current set
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
is False
constant attribute
{}
enumerate: ENUMERATE[E_]
effective function
{ANY}
get_new_iterator: ITERATOR[E_]
frozen
effective function
{ANY}
for_each (action: PROCEDURE[TUPLE[TUPLE 1[E_]]])
effective procedure
{ANY}
Apply action to every item of Current.
for_all (test: FUNCTION[TUPLE[TUPLE 1[E_]]]): BOOLEAN
effective function
{ANY}
Do all items satisfy test?
exists (test: FUNCTION[TUPLE[TUPLE 1[E_]]]): BOOLEAN
effective function
{ANY}
Does at least one item satisfy test?
aggregate (action: FUNCTION[TUPLE[TUPLE 2[E_, E_], E_]], initial: E_): E_
effective function
{ANY}
Aggregate all the elements starting from the initial value.
out_in_tagged_out_memory
effective procedure
{ANY}
Append terse printable representation of current object in tagged_out_memory.
generation: INTEGER_32
writable attribute
{ANY}
next_generation
effective procedure
{}
count: INTEGER_32
deferred function
{ANY}
Number of available items in the hoard.
do_all (action: ROUTINE[TUPLE[TUPLE 1[E_]]])
frozen
effective procedure
{ANY}
Apply action to every item of Current.
_inline_agent1 (a: ROUTINE[TUPLE[TUPLE 1[E_]]], e: E_)
frozen
effective procedure
{}
valid_index (i: INTEGER_32): BOOLEAN
effective function
{ANY}
True when i is valid (i.e., inside actual bounds).
test (e1: E_, e2: E_): BOOLEAN
effective function
{ANY}
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
{ANY}
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
{ANY}
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
{}
map: FAST_ARRAY[AVL_TREE_NODE[E_]]
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
{}
effective procedure
{}
lost_nodes: RECYCLING_POOL[AVL_TREE_NODE[E_]]
effective function
{}
lost_nodes_memory: RECYCLING_POOL[AVL_TREE_NODE[E_]]
writable attribute
{}
once function
{}
balanced: INTEGER_32
is 0
constant attribute
{}
imbalanced_left: INTEGER_32
is -1
constant attribute
{}
imbalanced_right: INTEGER_32
is 1
constant attribute
{}