Hashtable 成员

表示键/值对的集合,这些键/值对根据键的哈希代码进行组织。

下表列出了由 Hashtable 类型公开的成员。

公共构造函数

(请参见 受保护的构造函数 )

  名称 说明
Public method Supported by the .NET Compact Framework Hashtable 已重载。初始化 Hashtable 类的新实例。

页首

受保护的构造函数

  名称 说明
Protected method Hashtable 已重载。初始化 Hashtable 类的新实例。

页首

公共属性

(请参见 受保护的属性 )

  名称 说明
Public property Supported by the .NET Compact Framework Count 获取包含在 Hashtable 中的键/值对的数目。
Public property Supported by the .NET Compact Framework IsFixedSize 获取一个值,该值指示 Hashtable 是否具有固定大小。
Public property Supported by the .NET Compact Framework IsReadOnly 获取一个值,该值指示 Hashtable 是否为只读。
Public property Supported by the .NET Compact Framework IsSynchronized 获取一个值,该值指示是否同步对 Hashtable 的访问(线程安全)。
Public property Supported by the .NET Compact Framework Item 获取或设置与指定的键相关联的值。
Public property Supported by the .NET Compact Framework Keys 获取包含 Hashtable 中的键的 ICollection
Public property Supported by the .NET Compact Framework SyncRoot 获取可用于同步 Hashtable 访问的对象。
Public property Supported by the .NET Compact Framework Values 获取包含 Hashtable 中的值的 ICollection

页首

受保护的属性

  名称 说明
Protected property Supported by the .NET Compact Framework comparer 获取或设置要用于 HashtableIComparer
Protected property Supported by the .NET Compact Framework EqualityComparer 获取要用于 HashtableIEqualityComparer
Protected property Supported by the .NET Compact Framework hcp 获取或设置可分配哈希代码的对象。

页首

公共方法

(请参见 受保护的方法 )

  名称 说明
Public method Supported by the .NET Compact Framework Add 将带有指定键和值的元素添加到 Hashtable 中。
Public method Supported by the .NET Compact Framework Clear Hashtable 中移除所有元素。
Public method Supported by the .NET Compact Framework Clone 创建 Hashtable 的浅表副本。
Public method Supported by the .NET Compact Framework Contains 确定 Hashtable 是否包含特定键。
Public method Supported by the .NET Compact Framework ContainsKey 确定 Hashtable 是否包含特定键。
Public method Supported by the .NET Compact Framework ContainsValue 确定 Hashtable 是否包含特定值。
Public method Supported by the .NET Compact Framework CopyTo Hashtable 元素复制到一维 Array 实例中的指定索引位置。
Public method Supported by the .NET Compact Framework Equals  已重载。 确定两个 Object 实例是否相等。 (从 Object 继承。)
Public method Supported by the .NET Compact Framework GetEnumerator 返回循环访问 HashtableIDictionaryEnumerator
Public method Supported by the .NET Compact Framework GetHashCode  用作特定类型的哈希函数。GetHashCode 适合在哈希算法和数据结构(如哈希表)中使用。 (从 Object 继承。)
Public method GetObjectData 实现 ISerializable 接口,并返回序列化 Hashtable 所需的数据。
Public method Supported by the .NET Compact Framework GetType  获取当前实例的 Type。 (从 Object 继承。)
Public method OnDeserialization 实现 ISerializable 接口,并在完成反序列化之后引发反序列化事件。
Public method Static Supported by the .NET Compact Framework ReferenceEquals  确定指定的 Object 实例是否是相同的实例。 (从 Object 继承。)
Public method Supported by the .NET Compact Framework Remove Hashtable 中移除带有指定键的元素。
Public method Static Supported by the .NET Compact Framework Synchronized 返回 Hashtable 的同步(线程安全)包装。
Public method Supported by the .NET Compact Framework ToString  返回表示当前 ObjectString。 (从 Object 继承。)

页首

受保护的方法

  名称 说明
Protected method Supported by the .NET Compact Framework Finalize  允许 Object 在“垃圾回收”回收 Object 之前尝试释放资源并执行其他清理操作。 (从 Object 继承。)
Protected method Supported by the .NET Compact Framework GetHash 返回指定键的哈希代码。
Protected method Supported by the .NET Compact Framework KeyEquals 将特定 ObjectHashtable 中的特定键进行比较。
Protected method Supported by the .NET Compact Framework MemberwiseClone  创建当前 Object 的浅表副本。 (从 Object 继承。)

页首

显式接口实现

  名称 说明
Explicit interface implementation Method Supported by the .NET Compact Framework System.Collections.IEnumerable.GetEnumerator 返回一个循环访问集合的枚举数。

页首

请参见

参考

Hashtable 类
System.Collections 命名空间
IDictionary
IHashCodeProvider
Object.GetHashCode
Object.Equals
DictionaryEntry 结构
System.Collections.Generic.Dictionary
IEqualityComparer