System.Collections.Generic 命名空间

包含用于定义泛型集合的接口和类,可允许用户创建强类型集合,以提供比非泛型强类型集合更好的类型安全性和性能。

CollectionExtensions

为泛型集合提供扩展方法。

Comparer<T>

IComparer<T> 泛型接口的实现提供基类。

Dictionary<TKey,TValue>.KeyCollection

表示 Dictionary<TKey,TValue> 中密钥的集合。 此类不能被继承。

Dictionary<TKey,TValue>.ValueCollection

表示 Dictionary<TKey,TValue> 中值的集合。 此类不能被继承。

Dictionary<TKey,TValue>

表示键和值的集合。

EqualityComparer<T>

IEqualityComparer<T> 泛型接口的实现提供基类。

HashSet<T>

表示值的集。

KeyedByTypeCollection<TItem>

提供一个集合,该集合的项是用作键的类型。

KeyNotFoundException

当指定用于访问集合中元素的键与集合中的任意键均不匹配时所引发的异常。

KeyValuePair

创建 KeyValuePair<TKey,TValue> 结构的实例。

LinkedList<T>

表示双重链接列表。

LinkedListNode<T>

表示 LinkedList<T> 中的节点。 此类不能被继承。

List<T>

表示可通过索引访问的对象的强类型列表。 提供用于对列表进行搜索、排序和操作的方法。

PriorityQueue<TElement,TPriority>.UnorderedItemsCollection

枚举 PriorityQueue<TElement,TPriority>的内容,没有任何排序保证。

PriorityQueue<TElement,TPriority>

表示具有值和优先级的项的集合。 取消排队时,将删除优先级最低的项。

Queue<T>

表示对象的先进先出集合。

ReferenceEqualityComparer

IEqualityComparer<T>,它在比较两个对象实例时使用引用相等性 (ReferenceEquals(Object, Object)) 而不是值相等性 (Equals(Object))。

SortedDictionary<TKey,TValue>.KeyCollection

表示 SortedDictionary<TKey,TValue> 中密钥的集合。 此类不能被继承。

SortedDictionary<TKey,TValue>.ValueCollection

表示 SortedDictionary<TKey,TValue> 中值的集合。 此类不能被继承。

SortedDictionary<TKey,TValue>

表示根据键进行排序的键/值对的集合。

SortedList<TKey,TValue>

表示基于相关的 IComparer<T> 实现按键进行排序的键/值对的集合。

SortedSet<T>

表示按排序顺序维护的对象的集合。

Stack<T>

表示相同指定类型的实例可变大小的后进先出 (LIFO) 集合。

SynchronizedCollection<T>

提供一个线程安全集合,其中包含泛型参数所指定类型的对象作为元素。

SynchronizedKeyedCollection<K,T>

提供一个线程安全集合,该集合所含对象的类型由一个泛型参数指定,并且集合根据键进行分组。

SynchronizedReadOnlyCollection<T>

提供一个线程安全只读集合,该集合包含泛型参数所指定的类型的对象作为元素。

结构

Dictionary<TKey,TValue>.Enumerator

枚举 Dictionary<TKey,TValue> 的元素。

Dictionary<TKey,TValue>.KeyCollection.Enumerator

枚举 Dictionary<TKey,TValue>.KeyCollection 的元素。

Dictionary<TKey,TValue>.ValueCollection.Enumerator

枚举 Dictionary<TKey,TValue>.ValueCollection 的元素。

HashSet<T>.Enumerator

枚举 HashSet<T> 对象的元素。

KeyValuePair<TKey,TValue>

定义可设置或检索的键/值对。

LinkedList<T>.Enumerator

枚举 LinkedList<T> 的元素。

List<T>.Enumerator

枚举 List<T> 的元素。

PriorityQueue<TElement,TPriority>.UnorderedItemsCollection.Enumerator

枚举 的 元素和优先级对 PriorityQueue<TElement,TPriority>,没有任何排序保证。

Queue<T>.Enumerator

枚举 Queue<T> 的元素。

SortedDictionary<TKey,TValue>.Enumerator

枚举 SortedDictionary<TKey,TValue> 的元素。

SortedDictionary<TKey,TValue>.KeyCollection.Enumerator

枚举 SortedDictionary<TKey,TValue>.KeyCollection 的元素。

SortedDictionary<TKey,TValue>.ValueCollection.Enumerator

枚举 SortedDictionary<TKey,TValue>.ValueCollection 的元素。

SortedSet<T>.Enumerator

枚举 SortedSet<T> 对象的元素。

Stack<T>.Enumerator

枚举 Stack<T> 的元素。

接口

IAsyncEnumerable<T>

公开对指定类型的值提供异步迭代的枚举器。

IAsyncEnumerator<T>

支持在泛型集合上进行简单的异步迭代。

ICollection<T>

定义操作泛型集合的方法。

IComparer<T>

定义类型为比较两个对象而实现的方法。

IDictionary<TKey,TValue>

表示键/值对的泛型集合。

IEnumerable<T>

公开枚举数,该枚举数支持在指定类型的集合上进行简单迭代。

IEnumerator<T>

支持在泛型集合上进行简单迭代。

IEqualityComparer<T>

定义用于支持比较对象是否相等的方法。

IList<T>

表示可按照索引单独访问的对象的集合。

IReadOnlyCollection<T>

表示元素的强类型的只读集合。

IReadOnlyDictionary<TKey,TValue>

表示键/值对的泛型只读集合。

IReadOnlyList<T>

表示可按照索引进行访问的元素的只读集合。

IReadOnlySet<T>

提供集的只读抽象。

ISet<T>

提供用于集的抽象的基接口。

注解

许多泛型集合类型均为非泛型类型的直接模拟。 Dictionary<TKey,TValue>Hashtable 的泛型版本;它使用枚举的泛型结构 KeyValuePair<TKey,TValue> 而不是 DictionaryEntryList<T>ArrayList 的泛型版本。 存在响应非泛型版本的泛型 Queue<T>Stack<T> 类。 存在 SortedList<TKey,TValue> 的泛型和非泛型版本。 这两个版本均为字典和列表的混合。 SortedDictionary<TKey,TValue> 泛型类是一个纯字典,并且没有任何非泛型对应项。 泛 LinkedList<T> 型类是一个真正的链接列表,没有非泛型对应项。

另请参阅