ArrayList

ArrayList


A list that dynamically increases in size to hold a number of items.

Remarks

This class contains an internal array of Variants. As new items are added to the list, the capacity will increase as necessary.

The capacity of the list is the current number of elements in the internal-array.

To lower the capacity to save memory, use the TrimToSize method, or set Capacity directly.

The default capacity is 16. The Item index is zero based.

This class is persistable.

See Also

Project VBCorLib Overview | Constructors | ArrayListStatic | IList

Implements:

ICloneable 
ICollection 
IEnumerable 
IList 
IObject 

Public:

Properties:

NameDescription
 Capacity (get) Returns the total number of elements in the the internal array.  
 Capacity (let) Sets the number of allocated elements in the array.  
 Count (get) Returns the number of items in the list.  
 IsFixedSize (get) Returns if the list is fixed-size.  
 IsReadOnly (get) Returns if the list is read-only.  
 Item (get) Returns an item from the list.  
 Item (let) Sets an item in the list to a value.  
 Item (set) Sets an item in the list to a value.  
 Version (get) Returns the current version of the instance.  

Methods:

NameDescription
 Add Adds a new item to the end of the list.  
 AddRange Adds the items from a collection to the list.  
 BinarySearch Performs a binary search for the value in the internal list.  
 Clear Clears the list of all values.  
 Clone Returns an ArrayList object containing a copy of the array in the original ArrayList.  
 Contains Returns if the list contains a specific value.  
 CopyTo Copies all of the items to an array.  
 CopyToEx Copies a specified number of the items to an Array.  
 Equals Returns a boolean indicating if the value and this object instance are the same instance.  
 GetEnumerator Returns an enumerator for an ArrayList.  
 GetHashCode Returns a pseudo-unique number identifying this instance.  
 GetRange Returns an ArrayList object that is a windowed view into the original ArrayList.  
 IndexOf Returns the index of the first occurrence of the value in the list.  
 Insert Inserts a value into the list at the specified index.  
 InsertRange Inserts a collection of items into the list.  
 LastIndexOf Returns the last occurrence of a value in the list.  
 Remove Removes a value from the list.  
 RemoveAt Removes a value from the list at a specific index.  
 RemoveRange Remove a set of items from the list.  
 Reverse Reverses the list of items in the list.  
 SetRange Sets the items in the list to a collection of items.  
 Sort Sorts the items in the list.  
 ToArray Returns an array of the items in the list.  
 ToString Returns a string representation of this object instance.  
 TrimToSize Sets the capacity to the number of items in the list.