Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Implements the IList interface using an array whose size is dynamically increased as required.
Inheritance Hierarchy
System. . :: . .Object
System.Collections..::..ArrayList
Microsoft.SPOT.Net. . :: . .PrefixList
System.Security.Cryptography.X509Certificates. . :: . .X509Certificate2Collection
Namespace: System.Collections
Assembly: mscorlib (in mscorlib.dll)
Syntax
'Declaration
<SerializableAttribute> _
Public Class ArrayList _
Implements IList, ICollection, IEnumerable, ICloneable
[SerializableAttribute]
public class ArrayList : IList, ICollection,
IEnumerable, ICloneable
[SerializableAttribute]
public ref class ArrayList : IList,
ICollection, IEnumerable, ICloneable
[<SerializableAttribute>]
type ArrayList =
class
interface IList
interface ICollection
interface IEnumerable
interface ICloneable
end
public class ArrayList implements IList, ICollection, IEnumerable, ICloneable
The ArrayList type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
![]() |
ArrayList | Initializes a new instance of the ArrayList class that is empty and has the default initial capacity. |
Top
Properties
| Name | Description | |
|---|---|---|
![]() |
Capacity | Gets or sets the number of elements that the ArrayList can contain. |
![]() |
Count | Gets the number of elements actually contained in the ArrayList. |
![]() |
IsFixedSize | Gets a value indicating whether the ArrayList has a fixed size. |
![]() |
IsReadOnly | Gets a value indicating whether the ArrayList is read-only. |
![]() |
IsSynchronized | Gets a value indicating whether access to the ArrayList is synchronized (thread safe). |
![]() |
Item | Gets or sets the element at the specified index. |
![]() |
SyncRoot | Gets an object that can be used to synchronize access to the ArrayList. |
Top
Methods
| Name | Description | |
|---|---|---|
![]() |
Add | Adds an object to the end of the ArrayList. |
![]() |
BinarySearch | Searches the entire 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 | Creates a shallow copy of the ArrayList. |
![]() |
Contains | 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, Int32) | Copies the entire ArrayList to a compatible one-dimensional Array, starting at the specified index of the target array. |
![]() |
Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() |
GetEnumerator | Returns an enumerator for the entire ArrayList. |
![]() |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() |
GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() |
IndexOf(Object) | Searches for the specified Object and returns the zero-based index of the first occurrence within the entire ArrayList. |
![]() |
IndexOf(Object, Int32) | 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, Int32, Int32) | 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 | Inserts an element into the ArrayList at the specified index. |
![]() |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() |
Remove | Removes the first occurrence of a specific object from the ArrayList. |
![]() |
RemoveAt | Removes the element at the specified index of the ArrayList. |
![]() |
ToArray() () () () | Copies the elements of the ArrayList to a new Object array. |
![]() |
ToArray(Type) | Copies the elements of the ArrayList to a new array of the specified element type. |
![]() |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Top
Remarks
The ArrayList is not guaranteed to be sorted. You must sort the ArrayList prior to performing operations (such as BinarySearch) that require the ArrayList to be sorted.
The capacity of a ArrayList is the number of elements the ArrayList can hold. As elements are added to an ArrayList, the capacity is automatically increased as required through reallocation. The capacity can be decreased by calling TrimToSize or by setting the Capacity property explicitly.
For very large ArrayList objects, you can increase the maximum capacity to 2 billion elements on a 64-bit system by setting the enabled attribute of the gcAllowVeryLargeObjects configuration element to true in the run-time environment.
Elements in this collection can be accessed using an integer index. Indexes in this collection are zero-based.
The ArrayList collection accepts null Nothing nullptr unit a null reference (Nothing in Visual Basic) as a valid value, allows duplicate elements.
Using multidimensional arrays as elements in an ArrayList collection is not supported.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
.gif)
.gif)
.gif)