+
Point of view
All features
class EXT_AVL_DICTIONARY_NODE [V_, K_]
Summary
Auxiliary class to implement EXT_AVL_DICTIONARY.
Direct parents
Inherit list: ABSTRACT_AVL_DICTIONARY_NODE
Class invariant
Overview
Creation features
{EXT_AVL_DICTIONARY}
Features
{}
{ABSTRACT_AVL_DICTIONARY, ABSTRACT_AVL_DICTIONARY_NODE, ITERATOR_ON_AVL_DICTIONARY_ITEMS, ITERATOR_ON_AVL_DICTIONARY}
{ABSTRACT_AVL_DICTIONARY_NODE}
{ABSTRACT_AVL_DICTIONARY}
{RECYCLING_POOL}
  • recycle
    Do whatever needs to be done to free resources or recycle other objects when recycling this one
{ANY}
{AVL_TREE_NODE, AVL_TREE, AVL_TREE_ITERATOR}
Rotations:
{AVL_TREE}
  • rotate_right: EXT_AVL_DICTIONARY_NODE [V_, K_]
    Proceeds to some reorganisation and returns the upper node.
  • rotate_left: EXT_AVL_DICTIONARY_NODE [V_, K_]
    Proceeds to some reorganisation and returns the upper node.
{}
order: FUNCTION[TUPLE[TUPLE 2[K_, K_]]]
writable attribute
{}
ordered (k1: K_, k2: K_): BOOLEAN
effective function
{}
True if [e1, e2] is a correctly ordered sequence; usually, e1 < e2
require
  • k1 /= Void
  • k2 /= Void
make (a_order: FUNCTION[TUPLE[TUPLE 2[K_, K_]]])
effective procedure
{}
require
  • a_order /= Void
ensure
ensure
fast_at (k: ANY): EXT_AVL_DICTIONARY_NODE [V_, K_]
effective function
Is element e in the tree?
occurrences_ (v: V_, cnt: INTEGER_32): INTEGER_32
effective function
ensure
  • Result >= cnt
fast_occurrences_ (v: V_, cnt: INTEGER_32): INTEGER_32
effective function
ensure
  • Result >= cnt
set (v: V_, k: ANY)
effective procedure
ensure
recycle
effective procedure
Do whatever needs to be done to free resources or recycle other objects when recycling this one
out_in_tagged_out_memory
effective procedure
{ANY}
require
    • locked: tagged_out_locked
    • locked: tagged_out_locked
ensure
  • still_locked: tagged_out_locked
  • not_cleared: tagged_out_memory.count >= old tagged_out_memory.count
  • append_only: old tagged_out_memory.twin.is_equal(tagged_out_memory.substring(1, old tagged_out_memory.count))
safe_equal: SAFE_EQUAL[E_]
writable attribute
{ANY}
left: EXT_AVL_DICTIONARY_NODE [V_, K_]
writable attribute
right: EXT_AVL_DICTIONARY_NODE [V_, K_]
writable attribute
item: E_
writable attribute
balance: INTEGER_32
writable attribute
Balance factor; either balanced (the tree is balanced), imbalanced_left (the left branch is the longer) or imbalanced_right (the right branch is the longer)
count: INTEGER_32
effective function
height: INTEGER_32
effective function
map_in (map: COLLECTION[EXT_AVL_DICTIONARY_NODE [V_, K_]])
effective procedure
require
  • map /= Void
ensure
  • map.count = old map.count + count
has (e: E_): BOOLEAN
effective function
Is element e in the tree?
fast_has (e: E_): BOOLEAN
effective function
Is element e in the tree?
ensure
  • Result implies count > 0
at (e: E_): EXT_AVL_DICTIONARY_NODE [V_, K_]
effective function
Is element e in the tree?
set_item (i: E_)
effective procedure
require ensure
set_left (l: EXT_AVL_DICTIONARY_NODE [V_, K_])
effective procedure
require ensure
set_right (r: EXT_AVL_DICTIONARY_NODE [V_, K_])
effective procedure
require ensure
set_balance (b: INTEGER_32)
effective procedure
ensure
rotate_right: EXT_AVL_DICTIONARY_NODE [V_, K_]
effective function
Proceeds to some reorganisation and returns the upper node.
ensure
  • Result /= Void
rotate_left: EXT_AVL_DICTIONARY_NODE [V_, K_]
effective function
Proceeds to some reorganisation and returns the upper node.
ensure
  • Result /= Void
balanced: INTEGER_32
is 0
constant attribute
{}
imbalanced_left: INTEGER_32
is -1
constant attribute
{}
imbalanced_right: INTEGER_32
is 1
constant attribute
{}