IHash<TKey,TValue> 接口

定义

定义 STL/CLR hash_maphash_multimaphash_sethash_multiset 对象的接口。

generic <typename TKey, typename TValue>
public interface class IHash : ICloneable, Microsoft::VisualC::StlClr::Generic::IBidirectionalContainer<TValue>, System::Collections::ICollection
public interface IHash<TKey,TValue> : ICloneable, Microsoft.VisualC.StlClr.Generic.IBidirectionalContainer<TValue>, System.Collections.ICollection
type IHash<'Key, 'Value> = interface
    interface IBidirectionalContainer<'Value>
    interface ICloneable
    interface ICollection
    interface IEnumerable
Public Interface IHash(Of TKey, TValue)
Implements IBidirectionalContainer(Of TValue), ICloneable, ICollection

类型参数

TKey

受控序列中元素的键组件的类型。

TValue

受控序列中元素的值组件的类型。

实现

注解

有些方法(尤其是运算符)声明参数的类型,但不指定参数名称。 此类参数称为“未命名参数”。 在这些方法的文档中, A_0 占位符表示未命名参数。

有关详细信息,请 参阅 _ STL/clr) 的哈希映射 (哈希 _ 多重映射 (stl/clr) 哈希 _ 集 (stl/clr) 哈希集 (_ stl/clr)

属性

Count

获取 ICollection 中包含的元素数。

(继承自 ICollection)
IsSynchronized

获取一个值,该值指示是否同步对 ICollection 的访问(线程安全)。

(继承自 ICollection)
SyncRoot

获取可用于同步对 ICollection 的访问的对象。

(继承自 ICollection)

方法

begin(ContainerBidirectionalIterator<TValue>)

指定受控序列的开头。

bucket_count()

计算哈希表中的存储桶数。

clear()

从容器中移除所有元素。

Clone()

创建作为当前实例副本的新对象。

(继承自 ICloneable)
CopyTo(Array, Int32)

从特定的 ICollection 索引开始,将 Array 的元素复制到一个 Array 中。

(继承自 ICollection)
count(TKey)

查找与指定键匹配的元素数。

empty()

测试容器中是否不存在元素。

end(ContainerBidirectionalIterator<TValue>)

指定受控序列的末尾。

equal_range(GenericPair<ContainerBidirectionalIterator<TValue>,ContainerBidirectionalIterator<TValue>>, TKey)

查找与指定键匹配的范围。

erase(ContainerBidirectionalIterator<TValue>, ContainerBidirectionalIterator<TValue>)

从容器中移除由给定迭代器指定的元素。

erase(ContainerBidirectionalIterator<TValue>, ContainerBidirectionalIterator<TValue>, ContainerBidirectionalIterator<TValue>)

从容器中移除指定迭代器之间的元素。

erase(TKey)

从容器中移除与指定键匹配的元素。

find(ContainerBidirectionalIterator<TValue>, TKey)

查找与指定键匹配的元素。

get_generation()

获取基础容器的当前换代。

(继承自 IBidirectionalContainer<TValue>)
GetEnumerator()

返回循环访问集合的枚举数。

(继承自 IEnumerable)
hash_delegate()

返回用于将键值转换为整数的委托。

insert(ContainerBidirectionalIterator<TValue>, ContainerBidirectionalIterator<TValue>, TValue)

将给定元素添加到容器中。

insert(GenericPair<ContainerBidirectionalIterator<TValue>,Boolean>, TValue)

将给定值添加到容器。

insert(IEnumerable)

将给定的枚举添加到容器。

insert(IInputIterator<TValue>, IInputIterator<TValue>)

将给定迭代器指定的元素添加到容器中。

key_comp()

返回用于对受控序列进行排序的排序委托。 用于对两个键进行比较。

load_factor()

计算哈希表中每个存储桶的平均元素数。

lower_bound(ContainerBidirectionalIterator<TValue>, TKey)

查找与指定键匹配的元素范围的开始。

max_load_factor()

获取哈希表中每个存储桶的最大元素数。

max_load_factor(Single)

设置哈希表中每个存储桶的最大元素数。

rbegin(ReverseBidirectionalIterator<TValue>)

指定反向受控序列的开头。

rehash(Int32)

重新生成哈希表。

rend(ReverseBidirectionalIterator<TValue>)

指定反向受控序列的末尾。

size()

计算容器中的元素数。

swap(IHash<TKey,TValue>)

交换两个容器的内容。

upper_bound(ContainerBidirectionalIterator<TValue>, TKey)

查找与指定键匹配的元素范围的末尾。

value_comp()

返回用于对受控序列进行排序的排序委托。

扩展方法

Cast<TResult>(IEnumerable)

IEnumerable 的元素强制转换为指定的类型。

OfType<TResult>(IEnumerable)

根据指定类型筛选 IEnumerable 的元素。

AsParallel(IEnumerable)

启用查询的并行化。

AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryable

适用于