ArrayList.Adapter(IList) Metoda

Definicja

Tworzy otokę ArrayList dla określonego IListelementu .

public:
 static System::Collections::ArrayList ^ Adapter(System::Collections::IList ^ list);
public static System.Collections.ArrayList Adapter (System.Collections.IList list);
static member Adapter : System.Collections.IList -> System.Collections.ArrayList
Public Shared Function Adapter (list As IList) As ArrayList

Parametry

list
IList

Zawijanie IList .

Zwraca

Otoka ArrayList wokół .IList

Wyjątki

list to null.

Uwagi

Adapter nie kopiuje zawartości elementu IList. Zamiast tego tworzy tylko otokę ArrayList wokół IList, dlatego zmiany IList w obiekcie wpływają również na ArrayListelement .

Klasa ArrayList udostępnia ogólne ReverseBinarySearch metody i .Sort Ta otoka może być sposobem użycia tych metod w IListprogramie ; jednak wykonywanie tych operacji ogólnych za pośrednictwem otoki może być mniej wydajne niż operacje stosowane bezpośrednio w obiekcie IList.

Ta metoda jest operacją O(1) .

Dotyczy

Zobacz też