This documentation is archived and is not being maintained.

ArrayList.Adapter Method

Creates an ArrayList wrapper for a specific IList.

[Visual Basic]
Public Shared Function Adapter( _
   ByVal list As IList _
) As ArrayList
public static ArrayList Adapter(
 IList list
public: static ArrayList* Adapter(
 IList* list
public static function Adapter(
   list : IList
) : ArrayList;


The IList to wrap.

Return Value

The ArrayList wrapper around the IList.


Exception Type Condition
ArgumentNullException list is a null reference (Nothing in Visual Basic).


Adapter does not copy the contents of IList. Instead, it only creates an ArrayList wrapper around IList; therefore, changes to the IList also affect the ArrayList.

The ArrayList class provides generic Reverse, BinarySearch and Sort methods. This wrapper can be a means to use those methods on IList; however, performing these generic operations through the wrapper might be less efficient than operations applied directly on the IList.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Common Language Infrastructure (CLI) Standard

See Also

ArrayList Class | ArrayList Members | System.Collections Namespace | IList | BinarySearch | Reverse | Sort