System.Collections.ArrayList

WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS
namespace System.Collections
public class ArrayList

The System.Collections.ArrayList class is a dynamic collection class with 0‑based indexing (which means the index of the first element is 0). See "Variable references" in the Basic language elements topic for more information about array references.

Constructors

ArrayList

public ArrayList()

Initializes a new instance of ArrayList with a default capacity of 16 elements.

or

public ArrayList(capacity)

Initializes a new instance of ArrayList with the specified initial capacity (int), which is the number of elements the new array list can store.

Properties

ArrayList.Capacity

public virtual Capacity

Returns or sets the number of elements that the array list can contain. (int)

ArrayList.Count

public virtual Count

Returns the number of elements that are actually in the array list. (int)

ArrayList.Indexer

public virtual Indexer(index)

Returns the element in the array that is located at the index (1‑based, int). (@*)

Methods

ArrayList.Add

public virtual Add(object), int

Adds the specified element to the end of an array list and returns the array list index at which object has been added. Object can be null. (@*)

ArrayList.Clear

public virtual Clear(), void

Removes all elements from the array list. Sets count to zero and releases references to other objects.

ArrayList.Clone

public virtual Clone(), @Object

Returns a new array list that is a shallow copy of objects in the current array list. A shallow copy includes only the elements in the array list (not the objects that any references refer to).

ArrayList.IndexOf

IndexOf() determines equality by calling the Equals() method of the ArrayList element type.

public virtual IndexOf(object), int

Returns the first 0‑based index position for the specified object in the entire array list. Object can be null. (@*)

or

public virtual IndexOf(object, startindex), int

Returns the first 0‑based index position for the specified object (@*) within the range of elements between startindex (int) and the last element. Object can be null.

or

public virtual IndexOf(object, startindex, count), int

Returns the first 0‑based index position for the specified object (@*) within the range of elements starting at startindex (int) and continuing for the number of elements specified in count (int).

ArrayList.Insert

public virtual Insert(index, object), void

Inserts an element (@*) into the array list at the specified 0‑based index (int). Object can be null.

ArrayList.LastIndexOf

LastIndexOf() determines equality by calling the Equals() method of the ArrayList element type.

public virtual LastIndexOf(object), int

Returns the last 0‑based index position for the specified object (@*) in the entire array list. Object can be null.

or

public virtual LastIndexOf(object, startindex), int

Returns the last 0‑based index position for the specified object (@*) within the range of elements between the first element and startindex (int). Object can be null.

or

public virtual LastIndexOf(object, startindex, count), int

Returns the last 0‑based index position for the specified object within the range that contains count elements (int) and ends at startindex (int). In other words, it counts backwards from startindex for the number of elements specified in count. Object can be null. (@*)

ArrayList.RemoveAt

public virtual RemoveAt(index), void

Removes the element at the specified 0‑based index (int). The elements that follow are moved up to occupy the vacant spot.