+
Point of view
All features
class LINKED_LIST [E_]
Features
{}
- make
- is_empty: BOOLEAN
- add_first (element: E_)
- add_last (element: E_)
- add (element: E_, index: INTEGER_32)
- remove_first
- remove (index: INTEGER_32)
- first: E_
- last: E_
- item (index: INTEGER_32): E_
- put (element: E_, index: INTEGER_32)
- count: INTEGER_32
- set_all_with (v: E_)
- copy (other: LINKED_LIST [E_])
- fast_is_equal (other: LINKED_LIST [E_]): BOOLEAN
- is_equal (other: LINKED_LIST [E_]): BOOLEAN
- index_of (x: E_, start_index: INTEGER_32): INTEGER_32
- reverse_index_of (element: E_, start_index: INTEGER_32): INTEGER_32
- fast_index_of (x: E_, start_index: INTEGER_32): INTEGER_32
- fast_reverse_index_of (element: E_, start_index: INTEGER_32): INTEGER_32
- clear_count
- clear_count_and_capacity
- from_collection (model: TRAVERSABLE[E_])
- slice (low: INTEGER_32, up: INTEGER_32): LINKED_LIST [E_]
- occurrences (element: E_): INTEGER_32
- fast_occurrences (element: E_): INTEGER_32
- force (element: E_, index: INTEGER_32)
- all_default: BOOLEAN
- remove_last
- replace_all (old_value: E_, new_value: E_)
- fast_replace_all (old_value: E_, new_value: E_)
- new_iterator: ITERATOR[E_]
- reverse
{}
{}
{}
{}
{}
first_link: LINKED_LIST_NODE[E_]
writable attribute
last_link: LINKED_LIST_NODE[E_]
writable attribute
mem_lnk: LINKED_LIST_NODE[E_]
writable attribute
ensure
-
definition: Result = count = 0
ensure
- first = element
- count = 1 + old count
- lower = old lower
- upper = 1 + old upper
ensure
- last = element
- count = 1 + old count
- lower = old lower
- upper = 1 + old upper
require
- index.in_range(lower, upper + 1)
- index.in_range(lower, upper + 1)
ensure
- item(index) = element
- count = 1 + old count
- upper = 1 + old upper
require
ensure
- count = old count - 1
- lower = old lower + 1 xor upper = old upper - 1
require
ensure
- count = old count - 1
- upper = old upper - 1
require
ensure
-
definition: Result = item(lower)
require
ensure
-
definition: Result = item(upper)
require
ensure
- item(index) = element
- count = old count
copy (other: LINKED_LIST [E_])
effective procedure
require
- not immutable
- same_dynamic_type(other)
- not immutable
- same_dynamic_type(other)
- not immutable
- same_dynamic_type(other)
- not immutable
- same_dynamic_type(other)
- not immutable
- same_dynamic_type(other)
- not immutable
- same_dynamic_type(other)
ensure
fast_is_equal (other: LINKED_LIST [E_]):
BOOLEAN
effective function
ensure
- Result implies lower = other.lower and upper = other.upper
is_equal (other: LINKED_LIST [E_]):
BOOLEAN
effective function
require
ensure
- Result implies lower = other.lower and upper = other.upper
-
commutative: generating_type = other.generating_type implies Result = other.is_equal(Current)
ensure
- Result.in_range(start_index, upper + 1)
- valid_index(Result) implies (create {SAFE_EQUAL}).test(x, item(Result))
require
ensure
- Result.in_range(lower - 1, start_index)
- valid_index(Result) implies item(Result).is_equal(element)
ensure
- Result.in_range(start_index, upper + 1)
- valid_index(Result) implies x = item(Result)
require
ensure
- Result.in_range(lower - 1, start_index)
- valid_index(Result) implies item(Result) = element
ensure
- upper = 0
-
is_empty: count = 0
ensure
- upper = 0
-
is_empty: count = 0
from_collection (model: TRAVERSABLE[E_])
effective procedure
require
- model /= Void
-
useful_work: model /= Current
- model /= Void
-
useful_work: model /= Current
ensure
require
- lower <= low
- up <= upper
- low <= up + 1
- lower <= low
- up <= upper
- low <= up + 1
ensure
- same_dynamic_type(Result)
- Result.count = up - low + 1
- Result.lower = lower
require
ensure
- upper = index.max(old upper)
- item(index) = element
require
ensure
- count = old count - 1
- upper = old upper - 1
replace_all (old_value: E_, new_value: E_)
effective procedure
ensure
- count = old count
- not (create {SAFE_EQUAL}).test(old_value, new_value) implies occurrences(old_value) = 0
fast_replace_all (old_value: E_, new_value: E_)
effective procedure
ensure
- count = old count
- old_value /= new_value implies fast_occurrences(old_value) = 0
new_iterator: ITERATOR[E_]
effective function
ensure
- Result /= Void
- Result.generation = generation
free_nodes: WEAK_REFERENCE[LINKED_LIST_NODE[E_]]
writable attribute
{}
dispose_node (node: LINKED_LIST_NODE[E_]): LINKED_LIST_NODE[E_]
effective function
{}
new_node (e: E_, next: LINKED_LIST_NODE[E_]): LINKED_LIST_NODE[E_]
effective function
{}
frozen
effective function
require
ensure
-
definition: Result = item(i)
append_collection (other: COLLECTION[E_])
effective procedure
This feature is obsolete:
Use `append_traversable' instead.
append_traversable (other: TRAVERSABLE[E_])
effective procedure
ensure
-
definition: Result = valid_index(first_index_of(x))
ensure
-
definition: Result = valid_index(fast_first_index_of(x))
ensure
-
definition: Result = reverse_index_of(element, upper)
ensure
-
definition: Result = fast_reverse_index_of(element, upper)
is_equal_map (other: LINKED_LIST [E_]):
BOOLEAN
effective function
This feature is obsolete:
Use `is_equal' instead.
same_items (other: COLLECTION[E_]):
BOOLEAN
effective function
is False
constant attribute
{}
get_new_iterator: ITERATOR[E_]
frozen
effective function
This feature is obsolete:
Use `new_iterator' instead. This historical SmartEiffel feature is badly named.
aggregate (action:
FUNCTION[
TUPLE[TUPLE 2[E_, E_], E_]], initial: E_): E_
effective function
require
-
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))
frozen
effective procedure
This feature is obsolete:
Use `for_each` instead. This feature is not secure because it accepts a FUNCTION, the result of which is lost.
frozen
effective procedure
{}