ArrayList.Adapter(IList) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
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
參數
傳回
例外狀況
list
為 null
。
備註
Adapter 不會複製 的內容 IList 。 相反地,它只會在 周圍建立 ArrayList 包裝函式,因此對 的變更 IList 也會影響 ArrayList 。 IList
類別 ArrayList 提供泛型 Reverse 、 BinarySearch 和 Sort 方法。 這個包裝函式可以是在 上使用 IList 這些方法的方法;不過,透過包裝函式執行這些泛型作業可能比直接套用在 IList 上的作業更有效率。
這個方法是 O(1)
作業。
版本相容性
在 .NET Framework 1.0 和 1.1 版中,呼叫 GetEnumerator(Int32, Int32) 包裝函式上的 ArrayList 方法多載會傳回將第二個引數視為上限而非計數的列舉值。 在 .NET Framework 2.0 中,第二個引數會正確視為計數。
適用於
另請參閱
意見反應
提交並檢視相關的意見反應