System.Collections Namespace

System.Collections 命名空間 (Namespace) 包含介面和類別,它們會定義多種物件集合,例如清單、佇列、位元陣列、雜湊表和字典。 The System.Collections namespace contains interfaces and classes that define various collections of objects, such as lists, queues, bit arrays, hash tables and dictionaries.

類別

ArrayList

使用大小會視需要動態增加的陣列,實作 IList 介面。Implements the IList interface using an array whose size is dynamically increased as required.

BitArray

管理以布林 (Boolean) 表示的位元值之精簡陣列,其中 true 表示位元為開啟 (1),而 false 表示位元為關閉 (0)。Manages a compact array of bit values, which are represented as Booleans, where true indicates that the bit is on (1) and false indicates the bit is off (0).

CaseInsensitiveComparer

比較兩個物件是否相等,忽略字串的大小寫。Compares two objects for equivalence, ignoring the case of strings.

CaseInsensitiveHashCodeProvider

使用忽略字串大小寫的雜湊演算法,提供物件的雜湊程式碼。Supplies a hash code for an object, using a hashing algorithm that ignores the case of strings.

CollectionBase

為強類型集合提供 abstract 基底類別。Provides the abstract base class for a strongly typed collection.

Comparer

比較兩個物件是否相等,其中字串比較是區分大小寫的。Compares two objects for equivalence, where string comparisons are case-sensitive.

DictionaryBase

提供索引鍵/值組配對強式集合的 abstract 基底類別。Provides the abstract base class for a strongly typed collection of key/value pairs.

Hashtable

代表根據索引鍵的雜湊程式碼,所整理的索引鍵/值組集合。Represents a collection of key/value pairs that are organized based on the hash code of the key.

Queue

表示物件的先進先出 (FIFO) 集合。Represents a first-in, first-out collection of objects.

ReadOnlyCollectionBase

提供強式非泛型唯讀集合的 abstract 基底類別。Provides the abstract base class for a strongly typed non-generic read-only collection.

SortedList

表示索引鍵/值組配對的集合,這個集合按索引鍵排序,而且可以按索引鍵和索引存取。Represents a collection of key/value pairs that are sorted by the keys and are accessible by key and by index.

Stack

表示簡單之物件的後進先出 (Last-In First-Out,LIFO) 非泛型集合。Represents a simple last-in-first-out (LIFO) non-generic collection of objects.

StructuralComparisons

提供物件,用以執行兩個集合物件的結構比較。Provides objects for performing a structural comparison of two collection objects.

結構

DictionaryEntry

定義可設定或擷取的字典索引鍵/值組配對。Defines a dictionary key/value pair that can be set or retrieved.

介面

ICollection

定義所有非泛型集合的大小、列舉值和同步處理方法。Defines size, enumerators, and synchronization methods for all nongeneric collections.

IComparer

公開比較兩個物件的方法。Exposes a method that compares two objects.

IDictionary

表示索引鍵/值組的非泛型集合。Represents a nongeneric collection of key/value pairs.

IDictionaryEnumerator

列舉非泛型字典的項目。Enumerates the elements of a nongeneric dictionary.

IEnumerable

公開能逐一查看非泛型集合內容一次的列舉程式。Exposes an enumerator, which supports a simple iteration over a non-generic collection.

IEnumerator

支援非泛型集合上的簡單反覆運算。Supports a simple iteration over a non-generic collection.

IEqualityComparer

定義支援物件之相等比較的方法。Defines methods to support the comparison of objects for equality.

IHashCodeProvider

使用自訂雜湊函式,提供物件的雜湊程式碼。Supplies a hash code for an object, using a custom hash function.

IList

表示可以個別由索引存取之物件的非泛型集合。Represents a non-generic collection of objects that can be individually accessed by index.

IStructuralComparable

支援集合物件的結構比較。Supports the structural comparison of collection objects.

IStructuralEquatable

定義支援物件之結構相等比較的方法。Defines methods to support the comparison of objects for structural equality.