Fantasy
搜索结果

    显示/隐藏目录

    SortedOneToManyList<TKey, TValue> 类

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

    继承
    object
    SortedDictionary<TKey, List<TValue>>
    SortedOneToManyList<TKey, TValue>
    SortedOneToManyListPool<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 SortedOneToManyList<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

    列表中值的类型。

    构造函数

    | 编辑本文 查看源代码

    SortedOneToManyList()

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

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

    SortedOneToManyList(int)

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

    声明
    public SortedOneToManyList(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()

    重写 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