Skip to content

T_Cyjb_Collections_ReadOnlyPrefixTree_1

CYJB edited this page Mar 20, 2024 · 2 revisions

ReadOnlyPrefixTree(TValue) 类

表示只读的前缀树。

继承层次

System.Object
  Cyjb.Collections.ObjectModel.ReadOnlyDictionaryBase(String, TValue)
    Cyjb.Collections.ReadOnlyPrefixTree(TValue)
Namespace: Cyjb.Collections
Assembly: Cyjb (in Cyjb.dll) Version: 1.0.23+7750dd8e971297c5fa962a3bee37fb78f72793f6

语法

C#

public class ReadOnlyPrefixTree<TValue> : ReadOnlyDictionaryBase<string, TValue>

类型参数

 

TValue
前缀树的值的类型。
  The ReadOnlyPrefixTree(TValue) type exposes the following members.

构造函数

 

名称 说明
公共方法 ReadOnlyPrefixTree(TValue)(IEnumerable(KeyValuePair(String, TValue))) 使用指定的内容初始化 ReadOnlyPrefixTree(TValue) 类的新实例。
公共方法 ReadOnlyPrefixTree(TValue)(ReadOnlyPrefixTreeData(TValue)) 使用指定的预构建前缀树数据初始化 ReadOnlyPrefixTree(TValue) 类的新实例。
  Back to Top

属性

 

名称 说明
公共属性 Count 获取当前前缀树包含的元素数。 (重写 ReadOnlyDictionaryBase(TKey, TValue).Count.)
公共属性 Item 获取或设置具有指定键的元素。 (继承自 ReadOnlyDictionaryBase(TKey, TValue)。)
公共属性 Keys 获取包含当前前缀树的键的 ICollection(T)。 (重写 ReadOnlyDictionaryBase(TKey, TValue).Keys.)
公共属性 Values 获取包含当前前缀树的值的 ICollection(T)。 (重写 ReadOnlyDictionaryBase(TKey, TValue).Values.)
  Back to Top

方法

 

名称 说明
公共方法 ContainsKey 确定当前前缀树是否包含带有指定键的元素。 (重写 ReadOnlyDictionaryBase(TKey, TValue).ContainsKey(TKey).)
公共方法 Equals Determines whether the specified object is equal to the current object. (继承自 Object。)
受保护的方法 Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (继承自 Object。)
公共方法 GetData 返回当前前缀树的底层数据,用于序列化预构建的前缀树,减少运行时构建耗时。
公共方法 GetEnumerator 返回一个循环访问前缀树的枚举器。 (重写 ReadOnlyDictionaryBase(TKey, TValue).GetEnumerator().)
公共方法 GetHashCode Serves as the default hash function. (继承自 Object。)
受保护的方法 GetItem 获取具有指定键的元素。 (重写 ReadOnlyDictionaryBase(TKey, TValue).GetItem(TKey).)
受保护的方法 GetSyncRoot 获取一个可用于同步对当前字典的访问的对象。 (继承自 ReadOnlyDictionaryBase(TKey, TValue)。)
公共方法 GetType Gets the Type of the current instance. (继承自 Object。)
受保护的方法 MemberwiseClone Creates a shallow copy of the current Object. (继承自 Object。)
公共方法 ToString Returns a string that represents the current object. (继承自 Object。)
公共方法 TryGetValue 获取与指定键关联的值。 (重写 ReadOnlyDictionaryBase(TKey, TValue).TryGetValue(TKey, TValue).)
公共方法 TryMatchLongest 匹配最长的前缀。
公共方法 TryMatchShortest 匹配最短的前缀。
  Back to Top

Remarks

使用双数组表示,占用内存与字符集大小有关。注意会认为 null 和空字符串是相同的。

参见

Reference

Cyjb.Collections 命名空间

Clone this wiki locally