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

| Constructors | ArrayListStatic | IList

Implements:

ICloneable 
ICollection 
IEnumerable 
IList 
IObject 

NameDescription
 ICloneable_Clone ICloneable Interface  

NameDescription
 ICollection_CopyTo ICollection Interface  
 ICollection_GetEnumerator 
 ICollection_NewEnum 

NameDescription
 IEnumerable_GetEnumerator IEnumerable Interface  
 IEnumerable_NewEnum 

NameDescription
 IList_Add IList Interface  
 IList_Clear 
 IList_Contains 
 IList_CopyTo 
 IList_GetEnumerator 
 IList_IndexOf 
 IList_Insert 
 IList_NewEnum 
 IList_Remove 
 IList_RemoveAt 

NameDescription
 IObject_Equals IObject Interface  
 IObject_GetHashcode 
 IObject_ToString 

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.  

Private:

ArrayList

NameDescription
 Class_InitProperties Class Events  
 Class_ReadProperties 
 Class_WriteProperties 

Constants:

NameDescription
 DEF_CAPACITY 
 PROP_CAPACITY 
 PROP_COMPARER 
 PROP_COUNT 
 PROP_DEFAULTCOMPARER 
 PROP_ITEMPREFIX 
 PROP_SUBTYPE 
 SUBTYPE_EMPTY 
 SUBTYPE_NORMAL 
 SUBTYPE_NOTHING 

Properties:

NameDescription
 ICollection_Count (get) 
 IList_Count (get) 
 IList_IsFixedSize (get) 
 IList_IsReadOnly (get) 
 IList_Item (get) 
 IList_Item (let) 
 IList_Item (set) 
 mCapacity 
 mComparer 
 mCount 
 mItems 
 mVersion 

Methods:

NameDescription
 CloneHelper Friend Helpers  
 EnsureCapacity Private Helpers  
 Init 
 InsertSpace 
 NewEnum Returns an enumerator  
 RemoveSpace 
 WriteArray 
 WriteCollection 
 WriteICollection 
 WriteRange 
 WriteVBCollection