System.Collections.ArrayList Members

The members of System.Collections.ArrayList are listed below.

See Also: Inherited members from System.Object

Public Constructors

Initializes a new instance of the ArrayList class that is empty and has the default initial capacity.

Initializes a new instance of the ArrayList class that contains elements copied from the specified collection and that has the same initial capacity as the number of elements copied.

Initializes a new instance of the ArrayList class that is empty and has the specified initial capacity.

Public Properties

Capacityint.

Gets or sets the number of elements that the ArrayList can contain.

[read-only]
Countint.

Gets the number of elements actually contained in the ArrayList.

[read-only]
IsFixedSizebool.

Gets a value indicating whether the ArrayList has a fixed size.

[read-only]
IsReadOnlybool.

Gets a value indicating whether the ArrayList is read-only.

[read-only]
IsSynchronizedbool.

Gets a value indicating whether access to the ArrayList is synchronized (thread safe).

default property
Item(int)object. Gets or sets the element at the specified index of the current instance.
[read-only]
SyncRootobject.

Gets an object that can be used to synchronize access to the ArrayList.

Public Methods

static
Adapter(IList) : ArrayList

Creates an ArrayList wrapper for a specific IList.

Add(object) : int

Adds an object to the end of the ArrayList.

AddRange(ICollection)

Adds the elements of an ICollection to the end of the ArrayList.

BinarySearch(object) : int

Searches the entire sorted ArrayList for an element using the default comparer and returns the zero-based index of the element.

BinarySearch(object, IComparer) : int

Searches the entire sorted ArrayList for an element using the specified comparer and returns the zero-based index of the element.

BinarySearch(int, int, object, IComparer) : int

Searches a range of elements in the sorted ArrayList for an element using the specified comparer and returns the zero-based index of the element.

Clear()

Removes all elements from the ArrayList.

Clone() : object

Creates a shallow copy of the ArrayList.

Contains(object) : bool

Determines whether an element is in the ArrayList.

CopyTo(Array)

Copies the entire ArrayList to a compatible one-dimensional Array, starting at the beginning of the target array.

CopyTo(Array, int)

Copies the entire ArrayList to a compatible one-dimensional Array, starting at the specified index of the target array.

CopyTo(int, Array, int, int)

Copies a range of elements from the ArrayList to a compatible one-dimensional Array, starting at the specified index of the target array.

static
FixedSize(ArrayList) : ArrayList

Returns an ArrayList wrapper with a fixed size.

static
FixedSize(IList) : IList

Returns an IList wrapper with a fixed size.

GetEnumerator() : IEnumerator

Returns an enumerator for the entire ArrayList.

GetEnumerator(int, int) : IEnumerator

Returns an enumerator for a range of elements in the ArrayList.

GetRange(int, int) : ArrayList

Returns an ArrayList which represents a subset of the elements in the source ArrayList.

IndexOf(object) : int

Searches for the specified object and returns the zero-based index of the first occurrence within the entire ArrayList.

IndexOf(object, int) : int

Searches for the specified object and returns the zero-based index of the first occurrence within the range of elements in the ArrayList that extends from the specified index to the last element.

IndexOf(object, int, int) : int

Searches for the specified object and returns the zero-based index of the first occurrence within the range of elements in the ArrayList that starts at the specified index and contains the specified number of elements.

Insert(int, object)

Inserts an element into the ArrayList at the specified index.

InsertRange(int, ICollection)

Inserts the elements of a collection into the ArrayList at the specified index.

LastIndexOf(object) : int

Searches for the specified object and returns the zero-based index of the last occurrence within the entire ArrayList.

LastIndexOf(object, int) : int

Searches for the specified object and returns the zero-based index of the last occurrence within the range of elements in the ArrayList that extends from the first element to the specified index.

LastIndexOf(object, int, int) : int

Searches for the specified object and returns the zero-based index of the last occurrence within the range of elements in the ArrayList that contains the specified number of elements and ends at the specified index.

static
ReadOnly(ArrayList) : ArrayList

Returns a read-only ArrayList wrapper.

static
ReadOnly(IList) : IList

Returns a read-only IList wrapper.

Remove(object)

Removes the first occurrence of a specific object from the ArrayList.

RemoveAt(int)

Removes the element at the specified index of the ArrayList.

RemoveRange(int, int)

Removes a range of elements from the ArrayList.

static
Repeat(object, int) : ArrayList

Returns an ArrayList whose elements are copies of the specified value.

Reverse()

Reverses the order of the elements in the entire ArrayList.

Reverse(int, int)

Reverses the order of the elements in the specified range.

SetRange(int, ICollection)

Copies the elements of a collection over a range of elements in the ArrayList.

Sort()

Sorts the elements in the entire ArrayList.

Sort(IComparer)

Sorts the elements in the entire ArrayList using the specified comparer.

Sort(int, int, IComparer)

Sorts the elements in a range of elements in ArrayList using the specified comparer.

static
Synchronized(ArrayList) : ArrayList

Returns an ArrayList wrapper that is synchronized (thread safe).

static
Synchronized(IList) : IList

Returns an IList wrapper that is synchronized (thread safe).

ToArray() : object[]

Copies the elements of the ArrayList to a new object array.

ToArray(Type) : Array

Copies the elements of the ArrayList to a new array of the specified element type.

TrimToSize()

Sets the capacity to the actual number of elements in the ArrayList.