Fantasy
搜索结果

    显示/隐藏目录

    SortedOneToManyHashSet<TKey, TValue> 类

    基于排序字典实现的一对多关系的映射哈希集合类,将唯一键映射到多个值的哈希集合。 用于在多个值与一个键关联的情况下进行管理和存储。

    继承
    object
    SortedDictionary<TKey, HashSet<TValue>>
    SortedOneToManyHashSet<TKey, TValue>
    SortedOneToManyHashSetPool<TKey, TValue>
    实现
    IDictionary<TKey, HashSet<TValue>>
    ICollection<KeyValuePair<TKey, HashSet<TValue>>>
    IReadOnlyDictionary<TKey, HashSet<TValue>>
    IReadOnlyCollection<KeyValuePair<TKey, HashSet<TValue>>>
    IEnumerable<KeyValuePair<TKey, HashSet<TValue>>>
    IDictionary
    ICollection
    IEnumerable
    继承成员
    SortedDictionary<TKey, HashSet<TValue>>.Add(TKey, HashSet<TValue>)
    SortedDictionary<TKey, HashSet<TValue>>.Clear()
    SortedDictionary<TKey, HashSet<TValue>>.ContainsKey(TKey)
    SortedDictionary<TKey, HashSet<TValue>>.ContainsValue(HashSet<TValue>)
    SortedDictionary<TKey, HashSet<TValue>>.CopyTo(KeyValuePair<TKey, HashSet<TValue>>[], int)
    SortedDictionary<TKey, HashSet<TValue>>.GetEnumerator()
    SortedDictionary<TKey, HashSet<TValue>>.Remove(TKey)
    SortedDictionary<TKey, HashSet<TValue>>.TryGetValue(TKey, out HashSet<TValue>)
    SortedDictionary<TKey, HashSet<TValue>>.Comparer
    SortedDictionary<TKey, HashSet<TValue>>.Count
    SortedDictionary<TKey, HashSet<TValue>>.this[TKey]
    SortedDictionary<TKey, HashSet<TValue>>.Keys
    SortedDictionary<TKey, HashSet<TValue>>.Values
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    命名空间: Fantasy.DataStructure.Collection
    程序集: Fantasy.Net.dll
    语法
    public class SortedOneToManyHashSet<TKey, TValue> : SortedDictionary<TKey, HashSet<TValue>>, IDictionary<TKey, HashSet<TValue>>, ICollection<KeyValuePair<TKey, HashSet<TValue>>>, IReadOnlyDictionary<TKey, HashSet<TValue>>, IReadOnlyCollection<KeyValuePair<TKey, HashSet<TValue>>>, IEnumerable<KeyValuePair<TKey, HashSet<TValue>>>, IDictionary, ICollection, IEnumerable where TKey : notnull
    类型参数
    名称 描述
    TKey

    字典中键的类型。

    TValue

    集合中值的类型。

    构造函数

    | 编辑本文 查看源代码

    SortedOneToManyHashSet()

    创建一个新的 SortedOneToManyHashSet<TKey, TValue> 实例。

    声明
    public SortedOneToManyHashSet()
    | 编辑本文 查看源代码

    SortedOneToManyHashSet(int)

    创建一个新的 SortedOneToManyHashSet<TKey, TValue> 实例,设置最大缓存数量

    声明
    public SortedOneToManyHashSet(int recyclingLimit)
    参数
    类型 名称 描述
    int recyclingLimit

    1:防止数据量过大、所以超过recyclingLimit的数据还是走GC. 2:设置成0不控制数量,全部缓存

    方法

    | 编辑本文 查看源代码

    Add(TKey, TValue)

    将指定值添加到给定键关联的哈希集合中。

    声明
    public void Add(TKey key, TValue value)
    参数
    类型 名称 描述
    TKey key

    要添加值的键。

    TValue value

    要添加的值。

    | 编辑本文 查看源代码

    Clear()

    重写 Clear 方法,清空字典并清空回收队列。

    声明
    protected void Clear()
    | 编辑本文 查看源代码

    Contains(TKey, TValue)

    判断哈希集合中是否包含指定的键值对。

    声明
    public bool Contains(TKey key, TValue value)
    参数
    类型 名称 描述
    TKey key

    要查找的键。

    TValue value

    要查找的值。

    返回
    类型 描述
    bool

    如果键值对存在,则为 true;否则为 false。

    | 编辑本文 查看源代码

    RemoveKey(TKey)

    从字典中移除指定键以及关联的哈希集合,并将集合进行回收。 如果键不存在于映射列表中,则不执行任何操作。

    声明
    public void RemoveKey(TKey key)
    参数
    类型 名称 描述
    TKey key

    要移除的键。

    | 编辑本文 查看源代码

    RemoveValue(TKey, TValue)

    从指定键关联的哈希集合中移除特定值。 如果哈希集合不存在或值不存在于集合中,则不执行任何操作。

    声明
    public void RemoveValue(TKey key, TValue value)
    参数
    类型 名称 描述
    TKey key

    要移除值的键。

    TValue value

    要移除的值。

    实现

    IDictionary<TKey, TValue>
    ICollection<T>
    IReadOnlyDictionary<TKey, TValue>
    IReadOnlyCollection<T>
    IEnumerable<T>
    IDictionary
    ICollection
    IEnumerable

    扩展方法

    JsonHelper.ToJson<T>(T)
    DictionaryExtensions.TryRemove<T, TV>(IDictionary<T, TV>, T, out TV)
    • 编辑本文
    • 查看源代码
    本文内容
    Back to top Generated by DocFX