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
 AddAdds a new item to the end of the list. 
 AddRangeAdds the items from a collection to the list. 
 BinarySearchPerforms a binary search for the value in the internal list. 
 ClearClears the list of all values. 
 CloneReturns an ArrayList object containing a copy of the array in the original ArrayList. 
 ContainsReturns if the list contains a specific value. 
 CopyToCopies all of the items to an array. 
 CopyToExCopies a specified number of the items to an Array. 
 EqualsReturns a boolean indicating if the value and this object instance are the same instance. 
 GetEnumeratorReturns an enumerator for an ArrayList. 
 GetHashCodeReturns a pseudo-unique number identifying this instance. 
 GetRangeReturns an ArrayList object that is a windowed view into the original ArrayList. 
 IndexOfReturns the index of the first occurrence of the value in the list. 
 InsertInserts a value into the list at the specified index. 
 InsertRangeInserts a collection of items into the list. 
 LastIndexOfReturns the last occurrence of a value in the list. 
 RemoveRemoves a value from the list. 
 RemoveAtRemoves a value from the list at a specific index. 
 RemoveRangeRemove a set of items from the list. 
 ReverseReverses the list of items in the list. 
 SetRangeSets the items in the list to a collection of items. 
 SortSorts the items in the list. 
 ToArrayReturns an array of the items in the list. 
 ToStringReturns a string representation of this object instance. 
 TrimToSizeSets the capacity to the number of items in the list.