class RECYCLING_POOL [R_ -> RECYCLABLE]
Summary
Overview
Creation features
Exported features
  • item: R_
    Returns a recycled object, if there is one to be obtained.
  • recycle (an_item: R_)
    Stores the object as being reusable.
Creation and modification:
Modification:
Implementation of deferred:
Accessing:
Writing:
Adding:
  • add (element: ANY, 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.
  • append_collection (other: COLLECTION[E_])
    Append other to Current.
  • append_traversable (other: TRAVERSABLE[E_])
    Append other to Current.
Removing:
Looking and Searching:
Looking and comparison:
Other features:
Other features:
Agent-based features:
Printing:
Agent-based features:
Indexing:
Accessing:
  • first: E_
    The very first item.
  • last: E_
    The last item.
Interfacing with C:
item: R_
effective function
Returns a recycled object, if there is one to be obtained.
recycle (an_item: R_)
effective procedure
Stores the object as being reusable.
lower: INTEGER_32
is 0
constant attribute
Frozen lower bound.
default_create
effective procedure
Create a new with empty FAST_ARRAY with capacity 32.
make (new_count: INTEGER_32)
effective procedure
Make array with range [0 .. new_count - 1].
with_capacity (needed_capacity: INTEGER_32)
effective procedure
Create an empty array with at least needed_capacity.
resize (new_count: INTEGER_32)
effective procedure
Resize the array.
is_empty: BOOLEAN
effective function
Is the hoard empty ?
See also count.
put (element: E_, i: INTEGER_32)
effective procedure
Make element the item at index i.
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.
count: INTEGER_32
effective function
Number of available items in the hoard.
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).
copy (other: RECYCLING_POOL [R_ -> RECYCLABLE])
effective procedure
Copy other onto Current.
set_all_with (v: E_)
effective procedure
Set all items with value v.
from_collection (model: TRAVERSABLE[E_])
effective procedure
Initialize the current object with the contents of model.
fast_is_equal (other: RECYCLING_POOL [R_ -> RECYCLABLE]): BOOLEAN
effective function
Do both collections have the same lower, upper, and items?
is_equal (other: RECYCLING_POOL [R_ -> RECYCLABLE]): BOOLEAN
effective function
Do both collections have the same lower, upper, and items?
all_default: BOOLEAN
effective function
Do all items have their type's default value?
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.
first_index_of (element: E_): INTEGER_32
effective function
Give the index of the first occurrence of element using is_equal for comparison.
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 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_first_index_of (element: E_): INTEGER_32
effective function
Give the index of the first occurrence of element using basic = for comparison.
fast_index_of (element: 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.
subarray (min: INTEGER_32, max: INTEGER_32): RECYCLING_POOL [R_ -> RECYCLABLE]
effective function
New collection consisting of items at indexes in [min .. max].
slice (min: INTEGER_32, max: INTEGER_32): RECYCLING_POOL [R_ -> RECYCLABLE]
effective function
New collection consisting of items at indexes in [min..max].
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).
remove_first
effective procedure
Remove the first element of the collection.
remove_head (n: INTEGER_32)
effective procedure
Remove the n elements of the collection.
remove (index: INTEGER_32)
effective procedure
Remove the item at position index.
new_iterator: ITERATOR[E_]
effective function
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: ANY, 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.
add (element: ANY, index: INTEGER_32)
deferred procedure
Add a new element at rank index : count is increased by one and range [index .. upper] is shifted right by one position.
append_collection (other: COLLECTION[E_])
effective procedure
Append other to Current.
append_traversable (other: TRAVERSABLE[E_])
effective procedure
Append other to Current.
remove_last
deferred procedure
Remove the last item.
remove_tail (n: INTEGER_32)
deferred procedure
Remove the last n item(s).
has (x: ANY): BOOLEAN
effective function
Look for x using is_equal for comparison.
fast_has (x: ANY): BOOLEAN
effective function
Look for x using basic = for comparison.
last_index_of (element: ANY): INTEGER_32
effective function
Using is_equal for comparison, gives the index of the last occurrence of element at or before upper.
fast_last_index_of (element: ANY): INTEGER_32
effective function
Using basic = for comparison, gives the index of the last occurrence of element at or before upper.
is_equal_map (other: RECYCLING_POOL [R_ -> RECYCLABLE]): BOOLEAN
effective function
Do both collections have the same lower, upper, and items?
same_items (other: COLLECTION[E_]): BOOLEAN
effective function
Do both collections have the same items?
replace_all (old_value: ANY, new_value: ANY)
deferred procedure
Replace all occurrences of the element old_value by new_value using is_equal for comparison.
fast_replace_all (old_value: ANY, new_value: ANY)
deferred procedure
Replace all occurrences of the element old_value by new_value using basic = for comparison.
move (lower_index: INTEGER_32, upper_index: INTEGER_32, distance: INTEGER_32)
effective procedure
Move range lower_index ..
reverse
deferred procedure
Reverse the order of the elements.
enumerate: ENUMERATE[E_]
effective function
get_new_iterator: ITERATOR[E_]
frozen
effective function
for_each (action: PROCEDURE[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?
aggregate (action: FUNCTION[TUPLE[TUPLE 2[E_, E_], E_]], initial: E_): E_
effective function
Aggregate all the elements starting from the initial value.
out_in_tagged_out_memory
effective procedure
Append terse printable representation of current object in tagged_out_memory.
generation: INTEGER_32
writable attribute
do_all (action: ROUTINE[TUPLE[TUPLE 1[E_]]])
frozen
effective procedure
Apply action to every item of Current.
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).
first: E_
deferred function
The very first item.
last: E_
deferred function
The last item.
capacity: INTEGER_32
writable attribute
Internal storage capacity in number of item.
to_external: POINTER
effective function
Gives C access into the internal storage of the ARRAY.