Lisaac prototype interface

Section Header
+ name := ARRAY3[E];
- comment :=" General prurpose, resizable, three dimensional array..";
Section Inherit
+ parent_collection3:Expanded COLLECTION3[E];
Section Public
+ lower1:INTEGER;
+ lower2:INTEGER;
+ lower3:INTEGER;
+ upper1:INTEGER;
+ upper2:INTEGER;
+ upper3:INTEGER;
+ count1:INTEGER;
+ count2:INTEGER;
+ count3:INTEGER;
+ count:INTEGER;
Section ARRAY3
+ storage:NATIVE_ARRAY[E];
To store elements line by line.
+ capacity:INTEGER;
Number of elements in `storage'.
Section Public
Creation / modification:
- create (line_min, column_min, depth_min:INTEGER) to (line_max, column_max, depth_max:INTEGER) :SELF <-
Reset all bounds `line_minimum' / `line_maximum' / `column_minimum'
`column_maximum' / `depth_min' and `depth_max' using arguments as
new values. All elements are set to the default value of type E.
- make (line_min, column_min, depth_min:INTEGER) to (line_max, column_max, depth_max:INTEGER) <-
Reset all bounds `line_minimum' / `line_maximum' / `column_minimum'
`column_maximum' / `depth_min' and `depth_max' using arguments as
new values. All elements are set to the default value of type E.
- from_collection3 model:COLLECTION3[E] <-
- from_collection contents:COLLECTION[E] size (line_min,column_min,depth_min:INTEGER) to (line_max,column_max,depth_max:INTEGER) <-
Reset all bounds using `line_min', `line_max', `column_min',
`column_max', `depth_min', and `depth_max'.
Copy all elements of `contents', line by line into Current.
- from_model model:COLLECTION[COLLECTION[COLLECTION[E]]] <-
The `model' is used to fill line by line the COLLECTION3.
Assume all sub-collections of have the same indexing.
Resizing:
- resize (line_min, column_min, depth_min:INTEGER) to (line_max, column_max, depth_max:INTEGER) <-
Resize bounds of the Current array
Implementation of others feature from COLLECTION3:
- item (line, column, depth:INTEGER) :E <-
- put element:E to (line, column, depth:INTEGER) <-
- force x:E to (line, column, depth:INTEGER) <-
- set_all_with element:E <-
- replace_all old_value:E with new_value:E <-
- fast_replace_all old_value:E with new_value:E <-
- sub_collection3 (line_min, column_min, depth_min:INTEGER) to (line_max, column_max, depth_max:INTEGER) :SELF <-
Looking and comparison:
- occurrences elt:E :INTEGER <-
- fast_occurrences elt:E :INTEGER <-
- has x:E :BOOLEAN <-
Search if a element x is in the array using `equal'.
See also `fast_has' to choose the apropriate one.
- fast_has x:E :BOOLEAN <-
Search if a element x is in the array using `='.
- all_default:BOOLEAN <-
- swap (line1, column1, depth1:INTEGER) with (line2, column2, depth2:INTEGER) <-
- copy other:SELF <-
Invariant.
[ ...
-? { count1 = upper1 - lower1 + 1 };
-? { count2 = upper2 - lower2 + 1 };
-? { count3 = upper3 - lower3 + 1 };
-? { capacity >= count };
];