class TWO_WAY_LINKED_LIST [E_]
Summary
Class invariant
Overview
creation features
features
  • make
    Make an empty list
  • is_empty: BOOLEAN
    Is collection empty ?
    See also count.
  • add_first (element: E_)
    Add a new item in first position : count is increased by one and all other items are shifted right.
  • add_last (element: E_)
    Add a new item at the end : count is increased by one.
  • add (element: E_, index: INTEGER_32)
    Add a new element at rank index : count is increased by one and range [index .. upper] is shifted right by one position.
  • remove_first
    Remove the first element of the collection.
  • remove (index: INTEGER_32)
    Remove the item at position index.
  • first: E_
    The very first item.
  • last: E_
    The last item.
  • item (index: INTEGER_32): E_
    Item at the corresponding index i.
  • put (element: E_, index: INTEGER_32)
    Make element the item at index i.
  • count: INTEGER_32
    Number of available indices.
  • set_all_with (v: E_)
    Set all items with value v.
  • copy (other: TWO_WAY_LINKED_LIST [E_])
    Reinitialize by copying all the items of other.
  • is_equal (other: TWO_WAY_LINKED_LIST [E_]): BOOLEAN
    Do both collections have the same lower, upper, and items?
  • is_equal_map (other: TWO_WAY_LINKED_LIST [E_]): BOOLEAN
    Do both collections have the same lower, upper, and items?
  • index_of (x: E_, start_index: INTEGER_32): INTEGER_32
    Using is_equal for comparison, gives the index of the first occurrence of element at or after start_index.
  • reverse_index_of (element: E_, start_index: INTEGER_32): INTEGER_32
    Using is_equal for comparison, gives the index of the first occurrence of element at or before start_index.
  • fast_index_of (x: E_, start_index: INTEGER_32): INTEGER_32
    Using basic = for comparison, gives the index of the first occurrence of element at or after start_index.
  • fast_reverse_index_of (element: E_, start_index: INTEGER_32): INTEGER_32
    Using basic = comparison, gives the index of the first occurrence of element at or before start_index.
  • 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).
  • from_collection (model: TRAVERSABLE[E_])
    Initialize the current object with the contents of model.
  • slice (low: INTEGER_32, up: INTEGER_32): TWO_WAY_LINKED_LIST [E_]
    New collection consisting of items at indexes in [min..max].
  • occurrences (element: E_): INTEGER_32
    Number of occurrences of element using is_equal for comparison.
  • fast_occurrences (element: E_): INTEGER_32
    Number of occurrences of element using basic = for comparison.
  • force (element: E_, index: INTEGER_32)
    Make element the item at index, enlarging the collection if necessary (new bounds except index are initialized with default values).
  • all_default: BOOLEAN
    Do all items have their type's default value?
  • remove_last
    Remove the last item.
  • replace_all (old_value: E_, new_value: E_)
    Replace all occurrences of the element old_value by new_value using is_equal for comparison.
  • fast_replace_all (old_value: E_, new_value: E_)
    Replace all occurrences of the element old_value by new_value using basic = for comparison.
  • reverse
    Reverse the order of the elements.
  • get_new_iterator: ITERATOR[E_]
Accessing:
Writing:
Adding:
Removing:
Looking and Searching:
  • has (x: E_): BOOLEAN
    Look for x using is_equal for comparison.
  • fast_has (x: E_): BOOLEAN
    Look for x using basic = for comparison.
  • first_index_of (element: E_): INTEGER_32
    Give the index of the first occurrence of element using is_equal for comparison.
  • last_index_of (element: E_): INTEGER_32
    Using is_equal for comparison, gives the index of the last occurrence of element at or before upper.
  • fast_first_index_of (element: E_): INTEGER_32
    Give the index of the first occurrence of element using basic = for comparison.
  • fast_last_index_of (element: E_): INTEGER_32
    Using basic = for comparison, gives the index of the last occurrence of element at or before upper.
Looking and comparison:
Printing:
  • fill_tagged_out_memory
    Append a viewable information in tagged_out_memory in order to affect the behavior of out, tagged_out, etc.
Agents based features:
Other features:
Implement manifest generic creation:
Indexing:
Implement manifest generic creation:
first_link: TWO_WAY_LINKED_LIST_NODE[E_]
writable attribute
Void when empty or gives access to the first element.
last_link: TWO_WAY_LINKED_LIST_NODE[E_]
writable attribute
Void when empty or gives access to the last element.
mem_idx: INTEGER_32
writable attribute
writable attribute
To speed up accessing, mem_idx and mem_lnk is the memory of the last access done.
make
effective procedure
Make an empty list
is_empty: BOOLEAN
effective function
Is collection empty ?
See also count.
add_first (element: E_)
effective procedure
Add a new item in first position : count is increased by one and all other items are shifted right.
add_last (element: E_)
effective procedure
Add a new item at the end : count is increased by one.
add (element: E_, index: INTEGER_32)
effective procedure
Add a new element at rank index : count is increased by one and range [index .. upper] is shifted right by one position.
remove_first
effective procedure
Remove the first element of the collection.
remove (index: INTEGER_32)
effective procedure
Remove the item at position index.
first: E_
effective function
The very first item.
last: E_
effective function
The last item.
item (index: INTEGER_32): E_
effective function
Item at the corresponding index i.
put (element: E_, index: INTEGER_32)
effective procedure
Make element the item at index i.
count: INTEGER_32
effective function
Number of available indices.
set_all_with (v: E_)
effective procedure
Set all items with value v.
copy (other: TWO_WAY_LINKED_LIST [E_])
effective procedure
Reinitialize by copying all the items of other.
is_equal (other: TWO_WAY_LINKED_LIST [E_]): BOOLEAN
effective function
Do both collections have the same lower, upper, and items?
is_equal_map (other: TWO_WAY_LINKED_LIST [E_]): BOOLEAN
effective function
Do both collections have the same lower, upper, and items?
index_of (x: E_, start_index: INTEGER_32): INTEGER_32
effective function
Using is_equal for comparison, gives the index of the first occurrence of element at or after start_index.
reverse_index_of (element: E_, start_index: INTEGER_32): INTEGER_32
effective function
Using is_equal for comparison, gives the index of the first occurrence of element at or before start_index.
fast_index_of (x: E_, start_index: INTEGER_32): INTEGER_32
effective function
Using basic = for comparison, gives the index of the first occurrence of element at or after start_index.
fast_reverse_index_of (element: E_, start_index: INTEGER_32): INTEGER_32
effective function
Using basic = comparison, gives the index of the first occurrence of element at or before start_index.
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).
from_collection (model: TRAVERSABLE[E_])
effective procedure
Initialize the current object with the contents of model.
slice (low: INTEGER_32, up: INTEGER_32): TWO_WAY_LINKED_LIST [E_]
effective function
New collection consisting of items at indexes in [min..max].
occurrences (element: E_): INTEGER_32
effective function
Number of occurrences of element using is_equal for comparison.
fast_occurrences (element: E_): INTEGER_32
effective function
Number of occurrences of element using basic = for comparison.
force (element: E_, index: INTEGER_32)
effective procedure
Make element the item at index, enlarging the collection if necessary (new bounds except index are initialized with default values).
all_default: BOOLEAN
effective function
Do all items have their type's default value?
remove_last
effective procedure
Remove the last item.
replace_all (old_value: E_, new_value: E_)
effective procedure
Replace all occurrences of the element old_value by new_value using is_equal for comparison.
fast_replace_all (old_value: E_, new_value: E_)
effective procedure
Replace all occurrences of the element old_value by new_value using basic = for comparison.
reverse
effective procedure
Reverse the order of the elements.
get_new_iterator: ITERATOR[E_]
effective function
go_item (index: INTEGER_32)
effective procedure
writable attribute
If any, they are ready to be recycled.
once function
dispose_node (node: TWO_WAY_LINKED_LIST_NODE[E_]): TWO_WAY_LINKED_LIST_NODE[E_]
effective function
Add node in the free_nodes list.
new_node (e: E_, previous: TWO_WAY_LINKED_LIST_NODE[E_], next: TWO_WAY_LINKED_LIST_NODE[E_]): TWO_WAY_LINKED_LIST_NODE[E_]
effective function
Recycle from free_nodes or create a new one.
infix "@" (i: INTEGER_32): E_
frozen
effective function
The infix notation which is actually just a synonym for item.
swap (i1: INTEGER_32, i2: INTEGER_32)
effective procedure
Swap item at index i1 with item at index i2.
set_slice_with (v: E_, lower_index: INTEGER_32, upper_index: INTEGER_32)
effective procedure
Set all items in range [lower_index .. upper_index] with v.
clear_all
effective procedure
Set every item to its default value.
append_collection (other: COLLECTION[E_])
effective procedure
Append other to Current.
remove_head (n: INTEGER_32)
deferred procedure
Remove the n elements of the collection.
remove_tail (n: INTEGER_32)
deferred procedure
Remove the last n item(s).
has (x: E_): BOOLEAN
effective function
Look for x using is_equal for comparison.
fast_has (x: E_): BOOLEAN
effective function
Look for x using basic = for comparison.
first_index_of (element: E_): INTEGER_32
deferred function
Give the index of the first occurrence of element using is_equal for comparison.
last_index_of (element: E_): INTEGER_32
effective function
Using is_equal for comparison, gives the index of the last occurrence of element at or before upper.
fast_first_index_of (element: E_): INTEGER_32
deferred function
Give the index of the first occurrence of element using basic = for comparison.
fast_last_index_of (element: E_): INTEGER_32
effective function
Using basic = for comparison, gives the index of the last occurrence of element at or before upper.
same_items (other: COLLECTION[E_]): BOOLEAN
effective function
Do both collections have the same items?
fill_tagged_out_memory
frozen
effective procedure
Append a viewable information in tagged_out_memory in order to affect the behavior of out, tagged_out, etc.
do_all (action: ROUTINE[TUPLE[TUPLE 1[E_]]])
effective procedure
Apply action to every item of Current.
for_all (test: FUNCTION[TUPLE[TUPLE 1[E_]]]): BOOLEAN
effective function
Do all items satisfy test?
exists (test: FUNCTION[TUPLE[TUPLE 1[E_]]]): BOOLEAN
effective function
Does at least one item satisfy test?
move (lower_index: INTEGER_32, upper_index: INTEGER_32, distance: INTEGER_32)
effective procedure
Move range lower_index ..
manifest_semicolon_check: BOOLEAN
constant attribute
manifest_put (index: INTEGER_32, element: E_)
deferred procedure
lower: INTEGER_32
deferred function
Minimum index.
upper: INTEGER_32
deferred function
Maximum index.
valid_index (i: INTEGER_32): BOOLEAN
effective function
True when i is valid (i.e., inside actual bounds).
manifest_make (needed_capacity: INTEGER_32)
effective procedure
Manifest creation of a list of items of type E_.