instance (id) withCapacity int cap;
cap
elements without the need for resizing.
public int capacity;
void add All object;
object
at the end in the receiving array. If the
receiving array stores unboxed values, the object
is queried for its
value.
(int, int) adjustMutableRange (int, int) (start, len);
start
, len
) to fit the capacity of the receiving
MutableArray
. If len
== -1, it is adjusted to fit the capacity.
void empty post length == 0;
deferred id initWithCapacity int capacity;
capacity
items without needing to resize.
id initWith int n at pointer addr;
capacity
is set to the length
.
deferred void insert All object at int index pre index >= 0 && index <= length;
object
at the index
, shifting the objects at that or
a higher index up by 1 position.
deferred _builtin_.Any removeAt int index;
index
, decreasing the index of all
elements after index
, and return the element boxed. If the
receiving array stores unboxed values, such as integers, the value
returned is the element boxed.
void removeElementAt int index;
index
, decreasing the index of all
elements after index
.
deferred void removeElements (int, int) (start, length);
length
elements from start
. If length
== -1, all
elements from start
are removed.
void resize int to pre to >= 0;
deferred void resize (int, int) (start, num);
num
new entries at
start
filling newly created entries with the default values for the
type (i.e. 0).
void truncate int new_length pre new_length >= 0;
new_length
.
void bubbleSortUsingKey selector key comparator: selector cmp = selector (int compare All);
key
of the contained elements
by comparing them using the compare
selector.
private void bubbleSort (selector, selector) (key, compare) range (int, int) (start, beyond);
void quickSortUsingKey selector key comparator: selector compare = selector (int compare All);
key
of the contained elements
by comparing them using the compare
selector.
private void quickSort (selector, selector) (key, compare) range (int, int) (start, beyond);
quickSortUsingKey comparator
.
id initCopy;
super
does, adjust our (new) capacity
to
fit our length
.