Fantasy
搜索结果

    显示/隐藏目录

    SortedConcurrentOneToManyList<TKey, TValue> 类

    基于排序字典和并发集合实现的一多对映射列表类,继承自 SortedDictionary<TKey, TValue> 类, 用于在多个值与一个键关联的情况下进行管理和存储。该类支持并发操作,适用于多线程环境。

    继承
    object
    SortedDictionary<TKey, List<TValue>>
    SortedConcurrentOneToManyList<TKey, TValue>
    SortedConcurrentOneToManyListPool<TKey, TValue>
    实现
    IDictionary<TKey, List<TValue>>
    ICollection<KeyValuePair<TKey, List<TValue>>>
    IReadOnlyDictionary<TKey, List<TValue>>
    IReadOnlyCollection<KeyValuePair<TKey, List<TValue>>>
    IEnumerable<KeyValuePair<TKey, List<TValue>>>
    IDictionary
    ICollection
    IEnumerable
    继承成员
    SortedDictionary<TKey, List<TValue>>.Add(TKey, List<TValue>)
    SortedDictionary<TKey, List<TValue>>.Clear()
    SortedDictionary<TKey, List<TValue>>.ContainsKey(TKey)
    SortedDictionary<TKey, List<TValue>>.ContainsValue(List<TValue>)
    SortedDictionary<TKey, List<TValue>>.CopyTo(KeyValuePair<TKey, List<TValue>>[], int)
    SortedDictionary<TKey, List<TValue>>.GetEnumerator()
    SortedDictionary<TKey, List<TValue>>.Remove(TKey)
    SortedDictionary<TKey, List<TValue>>.TryGetValue(TKey, out List<TValue>)
    SortedDictionary<TKey, List<TValue>>.Comparer
    SortedDictionary<TKey, List<TValue>>.Count
    SortedDictionary<TKey, List<TValue>>.this[TKey]
    SortedDictionary<TKey, List<TValue>>.Keys
    SortedDictionary<TKey, List<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 SortedConcurrentOneToManyList<TKey, TValue> : SortedDictionary<TKey, List<TValue>>, IDictionary<TKey, List<TValue>>, ICollection<KeyValuePair<TKey, List<TValue>>>, IReadOnlyDictionary<TKey, List<TValue>>, IReadOnlyCollection<KeyValuePair<TKey, List<TValue>>>, IEnumerable<KeyValuePair<TKey, List<TValue>>>, IDictionary, ICollection, IEnumerable where TKey : notnull
    类型参数
    名称 描述
    TKey

    键的类型。

    TValue

    值的类型。

    构造函数

    | 编辑本文 查看源代码

    SortedConcurrentOneToManyList()

    初始化一个新的 SortedConcurrentOneToManyList<TKey, TValue> 类的实例,使用默认的参数设置。

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

    SortedConcurrentOneToManyList(int)

    初始化一个新的 SortedConcurrentOneToManyList<TKey, TValue> 类的实例,指定最大缓存数量。

    声明
    public SortedConcurrentOneToManyList(int recyclingLimit = 0)
    参数
    类型 名称 描述
    int recyclingLimit

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

    方法

    | 编辑本文 查看源代码

    Add(TKey, TValue)

    将指定的值添加到与指定键关联的列表中。

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

    要关联值的键。

    TValue value

    要添加到列表的值。

    | 编辑本文 查看源代码

    Clear()

    清空映射列表以及队列。

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

    Contains(TKey, TValue)

    检查指定的键和值是否存在于映射列表中。

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

    要检查的键。

    TValue value

    要检查的值。

    返回
    类型 描述
    bool

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

    | 编辑本文 查看源代码

    First(TKey)

    获取与指定键关联的列表中的第一个值。 如果列表不存在或为空,则返回默认值。

    声明
    public TValue First(TKey key)
    参数
    类型 名称 描述
    TKey key

    要获取第一个值的键。

    返回
    类型 描述
    TValue

    第一个值,或默认值。

    | 编辑本文 查看源代码

    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