System.Collections Namespace

System.Collections 命名空间包含接口和类,这些接口和类定义各种对象(如列表、队列、位数组、哈希表和字典)的集合。 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

管理位值的压缩数组,这些值以布尔值的形式表示,其中 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

表示对象的先进先出集合。 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

表示对象的简单后进先出 (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.