add
Appends element to the end of this list, growing the backing array when needed.
Duplicates are allowed. Successful insertion invalidates existing iterators.
Return
true after the element has been added.
Parameters
element
element to append.
Throws
if size is already Int.MAX_VALUE.
Inserts element at index, shifting following elements one position to the right.
An index equal to size appends to the list. Successful insertion invalidates existing iterators.
Parameters
index
insertion position, from zero through size inclusive.
element
element to insert.
Throws
if index is outside the insertion range or size is Int.MAX_VALUE.