Fantasy
搜索结果

    显示/隐藏目录

    ConcurrentOneToManyList<TKey, TValue> 类

    并发的一对多列表,用于维护具有相同键的多个值的关联关系。

    继承
    object
    ConcurrentDictionary<TKey, List<TValue>>
    ConcurrentOneToManyList<TKey, TValue>
    ConcurrentOneToManyListPool<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
    继承成员
    ConcurrentDictionary<TKey, List<TValue>>.AddOrUpdate(TKey, Func<TKey, List<TValue>>, Func<TKey, List<TValue>, List<TValue>>)
    ConcurrentDictionary<TKey, List<TValue>>.AddOrUpdate(TKey, List<TValue>, Func<TKey, List<TValue>, List<TValue>>)
    ConcurrentDictionary<TKey, List<TValue>>.AddOrUpdate<TArg>(TKey, Func<TKey, TArg, List<TValue>>, Func<TKey, List<TValue>, TArg, List<TValue>>, TArg)
    ConcurrentDictionary<TKey, List<TValue>>.Clear()
    ConcurrentDictionary<TKey, List<TValue>>.ContainsKey(TKey)
    ConcurrentDictionary<TKey, List<TValue>>.GetEnumerator()
    ConcurrentDictionary<TKey, List<TValue>>.GetOrAdd(TKey, Func<TKey, List<TValue>>)
    ConcurrentDictionary<TKey, List<TValue>>.GetOrAdd(TKey, List<TValue>)
    ConcurrentDictionary<TKey, List<TValue>>.GetOrAdd<TArg>(TKey, Func<TKey, TArg, List<TValue>>, TArg)
    ConcurrentDictionary<TKey, List<TValue>>.ToArray()
    ConcurrentDictionary<TKey, List<TValue>>.TryAdd(TKey, List<TValue>)
    ConcurrentDictionary<TKey, List<TValue>>.TryGetValue(TKey, out List<TValue>)
    ConcurrentDictionary<TKey, List<TValue>>.TryRemove(KeyValuePair<TKey, List<TValue>>)
    ConcurrentDictionary<TKey, List<TValue>>.TryRemove(TKey, out List<TValue>)
    ConcurrentDictionary<TKey, List<TValue>>.TryUpdate(TKey, List<TValue>, List<TValue>)
    ConcurrentDictionary<TKey, List<TValue>>.Comparer
    ConcurrentDictionary<TKey, List<TValue>>.Count
    ConcurrentDictionary<TKey, List<TValue>>.IsEmpty
    ConcurrentDictionary<TKey, List<TValue>>.this[TKey]
    ConcurrentDictionary<TKey, List<TValue>>.Keys
    ConcurrentDictionary<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 ConcurrentOneToManyList<TKey, TValue> : ConcurrentDictionary<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

    值的类型。

    构造函数

    | 编辑本文 查看源代码

    ConcurrentOneToManyList()

    初始化 ConcurrentOneToManyList<TKey, TValue> 类的新实例。

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

    ConcurrentOneToManyList(int)

    设置最大缓存数量

    声明
    public ConcurrentOneToManyList(int recyclingLimit)
    参数
    类型 名称 描述
    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