Fantasy
搜索结果

    显示/隐藏目录

    OneToManyDictionary<TKey, TValueKey, TValue> 类

    一对多映射关系的字典。每个键都对应一个内部字典,该内部字典将键值映射到相应的值。

    继承
    object
    Dictionary<TKey, Dictionary<TValueKey, TValue>>
    OneToManyDictionary<TKey, TValueKey, TValue>
    OneToManyDictionaryPool<TKey, TValueKey, TValue>
    实现
    IDictionary<TKey, Dictionary<TValueKey, TValue>>
    ICollection<KeyValuePair<TKey, Dictionary<TValueKey, TValue>>>
    IReadOnlyDictionary<TKey, Dictionary<TValueKey, TValue>>
    IReadOnlyCollection<KeyValuePair<TKey, Dictionary<TValueKey, TValue>>>
    IEnumerable<KeyValuePair<TKey, Dictionary<TValueKey, TValue>>>
    IDictionary
    ICollection
    IEnumerable
    IDeserializationCallback
    ISerializable
    继承成员
    Dictionary<TKey, Dictionary<TValueKey, TValue>>.Add(TKey, Dictionary<TValueKey, TValue>)
    Dictionary<TKey, Dictionary<TValueKey, TValue>>.Clear()
    Dictionary<TKey, Dictionary<TValueKey, TValue>>.ContainsKey(TKey)
    Dictionary<TKey, Dictionary<TValueKey, TValue>>.ContainsValue(Dictionary<TValueKey, TValue>)
    Dictionary<TKey, Dictionary<TValueKey, TValue>>.EnsureCapacity(int)
    Dictionary<TKey, Dictionary<TValueKey, TValue>>.GetEnumerator()
    Dictionary<TKey, Dictionary<TValueKey, TValue>>.GetObjectData(SerializationInfo, StreamingContext)
    Dictionary<TKey, Dictionary<TValueKey, TValue>>.OnDeserialization(object)
    Dictionary<TKey, Dictionary<TValueKey, TValue>>.Remove(TKey)
    Dictionary<TKey, Dictionary<TValueKey, TValue>>.Remove(TKey, out Dictionary<TValueKey, TValue>)
    Dictionary<TKey, Dictionary<TValueKey, TValue>>.TrimExcess()
    Dictionary<TKey, Dictionary<TValueKey, TValue>>.TrimExcess(int)
    Dictionary<TKey, Dictionary<TValueKey, TValue>>.TryAdd(TKey, Dictionary<TValueKey, TValue>)
    Dictionary<TKey, Dictionary<TValueKey, TValue>>.TryGetValue(TKey, out Dictionary<TValueKey, TValue>)
    Dictionary<TKey, Dictionary<TValueKey, TValue>>.Comparer
    Dictionary<TKey, Dictionary<TValueKey, TValue>>.Count
    Dictionary<TKey, Dictionary<TValueKey, TValue>>.this[TKey]
    Dictionary<TKey, Dictionary<TValueKey, TValue>>.Keys
    Dictionary<TKey, Dictionary<TValueKey, TValue>>.Values
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    命名空间: Fantasy.DataStructure.Dictionary
    程序集: Fantasy.Net.dll
    语法
    public class OneToManyDictionary<TKey, TValueKey, TValue> : Dictionary<TKey, Dictionary<TValueKey, TValue>>, IDictionary<TKey, Dictionary<TValueKey, TValue>>, ICollection<KeyValuePair<TKey, Dictionary<TValueKey, TValue>>>, IReadOnlyDictionary<TKey, Dictionary<TValueKey, TValue>>, IReadOnlyCollection<KeyValuePair<TKey, Dictionary<TValueKey, TValue>>>, IEnumerable<KeyValuePair<TKey, Dictionary<TValueKey, TValue>>>, IDictionary, ICollection, IEnumerable, IDeserializationCallback, ISerializable where TKey : notnull where TValueKey : notnull
    类型参数
    名称 描述
    TKey

    外部字典中的键类型。

    TValueKey

    内部字典中的键类型。

    TValue

    内部字典中的值类型。

    构造函数

    | 编辑本文 查看源代码

    OneToManyDictionary()

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

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

    OneToManyDictionary(int)

    创建一个新的 OneToManyDictionary<TKey, TValueKey, TValue> 实例,并指定最大缓存数量。

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

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

    方法

    | 编辑本文 查看源代码

    Add(TKey, TValueKey, TValue)

    向字典中添加指定的键值对。

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

    要添加键值对的键。

    TValueKey valueKey

    要添加键值对的内部字典键。

    TValue value

    要添加的值。

    | 编辑本文 查看源代码

    Clear()

    清空字典中的所有键值对,并将不再使用的内部字典实例放回对象池中。

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

    Contains(TKey, TValueKey)

    检查是否包含指定的键值对。

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

    外部字典中的键。

    TValueKey valueKey

    内部字典中的键。

    返回
    类型 描述
    bool

    如果包含指定的键值对,则为 true;否则为 false。

    | 编辑本文 查看源代码

    First(TKey)

    获取指定键的第一个值。

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

    要获取第一个值的键。

    返回
    类型 描述
    TValue
    | 编辑本文 查看源代码

    Remove(TKey, TValueKey)

    从字典中移除指定的键值对。

    声明
    public bool Remove(TKey key, TValueKey valueKey)
    参数
    类型 名称 描述
    TKey key

    要移除键值对的键。

    TValueKey valueKey

    要移除键值对的内部字典键。

    返回
    类型 描述
    bool

    如果成功移除键值对,则为 true;否则为 false。

    | 编辑本文 查看源代码

    Remove(TKey, TValueKey, out TValue)

    从字典中移除指定的键值对。

    声明
    public bool Remove(TKey key, TValueKey valueKey, out TValue value)
    参数
    类型 名称 描述
    TKey key

    要移除键值对的键。

    TValueKey valueKey

    要移除键值对的内部字典键。

    TValue value

    如果成功移除键值对,则为移除的值;否则为默认值。

    返回
    类型 描述
    bool

    如果成功移除键值对,则为 true;否则为 false。

    | 编辑本文 查看源代码

    RemoveKey(TKey)

    移除字典中的指定键及其相关的所有键值对。

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

    要移除的键。

    | 编辑本文 查看源代码

    TryGetValue(TKey, TValueKey, out TValue)

    尝试获取指定键值对的值。

    声明
    public bool TryGetValue(TKey key, TValueKey valueKey, out TValue value)
    参数
    类型 名称 描述
    TKey key

    外部字典中的键。

    TValueKey valueKey

    内部字典中的键。

    TValue value

    获取的值,如果操作成功,则为值;否则为默认值。

    返回
    类型 描述
    bool

    如果操作成功,则为 true;否则为 false。

    实现

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

    扩展方法

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