Lisaac prototype interface

Section Header
+ name := FAST_ARRAY[E];
- author :="Boutet Jerome (boutet@loria.fr)";
- comment :="Resizable, fixed lower bound array.\ \Unlike ARRAY, the `lower' bound of a FAST_ARRAY is frozen \ \to 0. Thus, some memory is saved and looping toward `lower' \ \bound (which is 0) run a little bit faster.";
General purpose resizable FAST_ARRAYs. The only difference with ARRAY is the
fact that the `lower' bound is actually frozen to 0. The `item' access is likely
to be more efficient as well as loop going from `upper' to `lower' just because
`lower' is 0. Keep in mind that even if the `lower' is frozen to 0
it is really better to use the `lower' attribute, and not 0 directly, just because
you may decide in the future to use another COLLECTION implementation.
Like ARRAY, the FAST_ARRAY implementation uses only one chunk of memory, the
`storage' area which is a NATIVE_ARRAY. One must keep in mind that this internal
`storage' area is always kept left align. Thus, you can expect good performances
while using a FAST_ARRAY to modelize a stack behavior with
`add_last' / `last' / `remove_last'. Conversely `add_first' and `remove_first' are
likely to slow down your program if they are too often used. If the fact that
`lower' is stuck to 0 do matter, also consider ARRAY.
Section Inherit
+ parent_arrayed_collection:Expanded ARRAYED_COLLECTION[E];
Section Public
- lower:INTEGER :=
Frozen lower bound.
Creation and modification:
- create new_count:INTEGER :SELF <-
Make array with range [0 .. `new_count' - 1].
When `new_count' = 0 the array is empty.
- create_with_capacity new_count:INTEGER :SELF <-
Create an empty array with at least `needed_capacity'.
- create_with_native_array_byte na:NATIVE_ARRAY[UINTEGER_8] size s:INTEGER :SELF <-
- make_with_map_object obj:OBJECT <-
BSBS: A revoir.
- make_with_native_array_byte na:NATIVE_ARRAY[UINTEGER_8] size s:INTEGER <-
- make new_count:INTEGER <-
Make array with range [0 .. `new_count' - 1].
When `new_count' = 0 the array is empty.
- with_capacity needed_capacity:INTEGER <-
Create an empty array with at least `needed_capacity'.
Hashable.
- hash_code:INTEGER <-
Modification:
- set_capacity new_capacity:INTEGER <-
Resize capacity the array, but not count.
- resize new_count:INTEGER <-
Resize the array. When `new_count' is greater than
`count', new positions are initialized with appropriate
default values.
Implementation of deferred:
- is_empty:BOOLEAN <-
end is_empty
- item i:INTEGER :E <-
- put element:E to i:INTEGER <-
- add_first element:E <-
- add_last element:E <-
- count:INTEGER <-
end count
- clear <-
- copy other:FAST_ARRAY[E] <-
Copy `other' onto Current.
- set_all_with v:E <-
Sort
- bubble_sort <-
Bubble sort :-( => BSBS: Optmize with Quick sort...
- from_collection model:COLLECTION[E] <-
- '==' Right 60 other:COLLECTION[E] :BOOLEAN <-
- is_equal_map other:SELF :BOOLEAN <-
- all_default:BOOLEAN <-
- occurrences element:E :INTEGER <-
- fast_occurrences element:E :INTEGER <-
- first_index_of element:E :INTEGER <-
- index_of element:E start start_index:INTEGER :INTEGER <-
- reverse_index_of element:E start start_index:INTEGER :INTEGER <-
- fast_first_index_of element:E :INTEGER <-
- fast_index_of element:E start start_index:INTEGER :INTEGER <-
- fast_reverse_index_of element:E start start_index:INTEGER :INTEGER <-
- subarray min:INTEGER to max:INTEGER :SELF <-
slice
- force element:E to index:INTEGER <-
- remove_first <-
- remove_head n:INTEGER <-
- remove index:INTEGER <-
- remove beg:INTEGER to end:INTEGER <-
- remove_since beg:INTEGER <-
Guru Section.
- set_upper new_up:INTEGER <-