ArrayList

Constructors

this
this(int initialCapacity)

Constructs an empty list with the specified initial capacity.

this
this()

Constructs an empty list with an initial capacity of ten.

this
this(Array!E arr)

Constructs a list containing the elements of the specified collection, in the order they are returned by the collection's iterator.

this
this(E[] arr)
Undocumented in source.
this
this(Collection!E c)
Undocumented in source.

Members

Aliases

add
alias add = AbstractList!(E).add
Undocumented in source.

Functions

add
bool add(E e)

Appends the specified element to the end of this list.

add
void add(int index, E element)

Inserts the specified element at the specified position in this list. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).

clear
void clear()

Removes all of the elements from this list. The list will be empty after this call returns.

contains
bool contains(E o)

Returns <tt>true</tt> if this list contains the specified element. More formally, returns <tt>true</tt> if and only if this list contains at least one element <tt>e</tt> such that <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>.

elementData
E elementData(int index)
Undocumented in source. Be warned that the author may not have intended to support it.
get
E get(int index)

Returns the element at the specified position in this list.

indexOf
int indexOf(E o)
Undocumented in source. Be warned that the author may not have intended to support it.
isEmpty
bool isEmpty()

Returns <tt>true</tt> if this list contains no elements.

iterator
InputRange!E iterator()

Returns an iterator over the elements in this list in proper sequence.

lastIndexOf
int lastIndexOf(E o)
Undocumented in source. Be warned that the author may not have intended to support it.
opApply
int opApply(int delegate(ref E) dg)
Undocumented in source. Be warned that the author may not have intended to support it.
remove
bool remove(E o)

Removes the first occurrence of the specified element from this list, if it is present. If the list does not contain the element, it is unchanged. More formally, removes the element with the lowest index <tt>i</tt> such that <tt>(o==null&nbsp;?&nbsp;get(i)==null&nbsp;:&nbsp;o.equals(get(i)))</tt> (if such an element exists). Returns <tt>true</tt> if this list contained the specified element (or equivalently, if this list changed as a result of the call).

removeAt
E removeAt(int index)

Removes the element at the specified position in this list. Shifts any subsequent elements to the left (subtracts one from their indices).

removeRange
void removeRange(int fromIndex, int toIndex)

Removes from this list all of the elements whose index is between {@code fromIndex}, inclusive, and {@code toIndex}, exclusive. Shifts any succeeding elements to the left (reduces their index). This call shortens the list by {@code (toIndex - fromIndex)} elements. (If {@code toIndex==fromIndex}, this operation has no effect.)

set
E set(int index, E element)

Replaces the element at the specified position in this list with the specified element.

size
int size()

Returns the number of elements in this list.

sort
void sort(bool isAscending)

Returns a view of the portion of this list between the specified {@code fromIndex}, inclusive, and {@code toIndex}, exclusive. (If {@code fromIndex} and {@code toIndex} are equal, the returned list is empty.) The returned list is backed by this list, so non-structural changes in the returned list are reflected in this list, and vice-versa. The returned list supports all of the optional list operations.

sort
void sort(Comparator!E c)
Undocumented in source. Be warned that the author may not have intended to support it.
toArray
E[] toArray()

Returns an array containing all of the elements in this list in proper sequence (from first to last element).

Variables

_array
Array!(E) _array;
Undocumented in source.

Meta