Fantasy
搜索结果

    显示/隐藏目录

    OneToManyHashSet<TKey, TValue> 类

    一对多哈希集合(OneToManyHashSet),用于创建和管理键对应多个值的集合。

    继承
    object
    Dictionary<TKey, HashSet<TValue>>
    OneToManyHashSet<TKey, TValue>
    OneToManyHashSetPool<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
    IDeserializationCallback
    ISerializable
    继承成员
    Dictionary<TKey, HashSet<TValue>>.Add(TKey, HashSet<TValue>)
    Dictionary<TKey, HashSet<TValue>>.Clear()
    Dictionary<TKey, HashSet<TValue>>.ContainsKey(TKey)
    Dictionary<TKey, HashSet<TValue>>.ContainsValue(HashSet<TValue>)
    Dictionary<TKey, HashSet<TValue>>.EnsureCapacity(int)
    Dictionary<TKey, HashSet<TValue>>.GetEnumerator()
    Dictionary<TKey, HashSet<TValue>>.GetObjectData(SerializationInfo, StreamingContext)
    Dictionary<TKey, HashSet<TValue>>.OnDeserialization(object)
    Dictionary<TKey, HashSet<TValue>>.Remove(TKey)
    Dictionary<TKey, HashSet<TValue>>.Remove(TKey, out HashSet<TValue>)
    Dictionary<TKey, HashSet<TValue>>.TrimExcess()
    Dictionary<TKey, HashSet<TValue>>.TrimExcess(int)
    Dictionary<TKey, HashSet<TValue>>.TryAdd(TKey, HashSet<TValue>)
    Dictionary<TKey, HashSet<TValue>>.TryGetValue(TKey, out HashSet<TValue>)
    Dictionary<TKey, HashSet<TValue>>.Comparer
    Dictionary<TKey, HashSet<TValue>>.Count
    Dictionary<TKey, HashSet<TValue>>.this[TKey]
    Dictionary<TKey, HashSet<TValue>>.Keys
    Dictionary<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 OneToManyHashSet<TKey, TValue> : Dictionary<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, IDeserializationCallback, ISerializable where TKey : notnull
    类型参数
    名称 描述
    TKey

    键的类型。

    TValue

    值的类型。

    构造函数

    | 编辑本文 查看源代码

    OneToManyHashSet()

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

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

    OneToManyHashSet(int)

    设置最大缓存数量

    声明
    public OneToManyHashSet(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。

    | 编辑本文 查看源代码

    GetValue(TKey)

    获取指定键对应的值集合,如果不存在则返回一个空的哈希集合。

    声明
    public HashSet<TValue> GetValue(TKey key)
    参数
    类型 名称 描述
    TKey key

    键。

    返回
    类型 描述
    HashSet<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
    IDeserializationCallback
    ISerializable

    扩展方法

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