Fantasy
搜索结果

    显示/隐藏目录

    OneToManyQueue<TKey, TValue> 类

    支持一对多关系的队列,用于存储具有相同键的值的队列集合。

    继承
    object
    Dictionary<TKey, Queue<TValue>>
    OneToManyQueue<TKey, TValue>
    OneToManyQueuePool<TKey, TValue>
    实现
    IDictionary<TKey, Queue<TValue>>
    ICollection<KeyValuePair<TKey, Queue<TValue>>>
    IReadOnlyDictionary<TKey, Queue<TValue>>
    IReadOnlyCollection<KeyValuePair<TKey, Queue<TValue>>>
    IEnumerable<KeyValuePair<TKey, Queue<TValue>>>
    IDictionary
    ICollection
    IEnumerable
    IDeserializationCallback
    ISerializable
    继承成员
    Dictionary<TKey, Queue<TValue>>.Add(TKey, Queue<TValue>)
    Dictionary<TKey, Queue<TValue>>.Clear()
    Dictionary<TKey, Queue<TValue>>.ContainsKey(TKey)
    Dictionary<TKey, Queue<TValue>>.ContainsValue(Queue<TValue>)
    Dictionary<TKey, Queue<TValue>>.EnsureCapacity(int)
    Dictionary<TKey, Queue<TValue>>.GetEnumerator()
    Dictionary<TKey, Queue<TValue>>.GetObjectData(SerializationInfo, StreamingContext)
    Dictionary<TKey, Queue<TValue>>.OnDeserialization(object)
    Dictionary<TKey, Queue<TValue>>.Remove(TKey)
    Dictionary<TKey, Queue<TValue>>.Remove(TKey, out Queue<TValue>)
    Dictionary<TKey, Queue<TValue>>.TrimExcess()
    Dictionary<TKey, Queue<TValue>>.TrimExcess(int)
    Dictionary<TKey, Queue<TValue>>.TryAdd(TKey, Queue<TValue>)
    Dictionary<TKey, Queue<TValue>>.TryGetValue(TKey, out Queue<TValue>)
    Dictionary<TKey, Queue<TValue>>.Comparer
    Dictionary<TKey, Queue<TValue>>.Count
    Dictionary<TKey, Queue<TValue>>.this[TKey]
    Dictionary<TKey, Queue<TValue>>.Keys
    Dictionary<TKey, Queue<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 OneToManyQueue<TKey, TValue> : Dictionary<TKey, Queue<TValue>>, IDictionary<TKey, Queue<TValue>>, ICollection<KeyValuePair<TKey, Queue<TValue>>>, IReadOnlyDictionary<TKey, Queue<TValue>>, IReadOnlyCollection<KeyValuePair<TKey, Queue<TValue>>>, IEnumerable<KeyValuePair<TKey, Queue<TValue>>>, IDictionary, ICollection, IEnumerable, IDeserializationCallback, ISerializable where TKey : notnull
    类型参数
    名称 描述
    TKey

    键的类型。

    TValue

    值的类型。

    构造函数

    | 编辑本文 查看源代码

    OneToManyQueue(int)

    创建一个 OneToManyQueue<TKey, TValue> 一对多关系的队列的实例。设置最大缓存数量

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

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

    方法

    | 编辑本文 查看源代码

    Clear()

    清空当前实例的数据,同时回收所有值队列。

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

    Contains(TKey, TValue)

    判断指定键的值队列是否包含指定的值。

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

    要查找的键。

    TValue value

    要查找的值。

    返回
    类型 描述
    bool

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

    | 编辑本文 查看源代码

    Dequeue(TKey)

    从指定键的值队列中出队一个值。

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

    要出队的键。

    返回
    类型 描述
    TValue

    出队的值。

    | 编辑本文 查看源代码

    Enqueue(TKey, TValue)

    将指定的值添加到指定键的值队列中。

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

    要添加值的键。

    TValue value

    要添加的值。

    | 编辑本文 查看源代码

    RemoveKey(TKey)

    从字典中移除指定键及其对应的值队列。

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

    要移除的键。

    | 编辑本文 查看源代码

    TryDequeue(TKey, out TValue)

    尝试从指定键的值队列中出队一个值。

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

    要出队的键。

    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