Class MultiValueSortedList<TKey, TValue>
- Namespace
- Stride.Core.Collections
- Assembly
- Stride.Core.dll
Represents a priority queue, where keys are sorted and each key might have mlutiple values.
public class MultiValueSortedList<TKey, TValue> : ILookup<TKey, TValue>, IEnumerable<IGrouping<TKey, TValue>>, ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, ICollection, IEnumerable where TKey : IComparable<TKey>Type Parameters
- TKey
- The type of the key. 
- TValue
- The type of the value. 
- Inheritance
- 
      objectMultiValueSortedList<TKey, TValue>
- Implements
- 
      ILookup<TKey, TValue>IEnumerable<IGrouping<TKey, TValue>>ICollection<KeyValuePair<TKey, TValue>>IEnumerable<KeyValuePair<TKey, TValue>>
- Extension Methods
Remarks
Properties
Count
Gets the number of key/value collection pairs in the ILookup<TKey, TElement>.
public int Count { get; }Property Value
- int
- The number of key/value collection pairs in the ILookup<TKey, TElement>. 
IsFixedSize
public bool IsFixedSize { get; }Property Value
IsReadOnly
Gets a value indicating whether the ICollection<T> is read-only.
public bool IsReadOnly { get; }Property Value
- bool
- true if the ICollection<T> is read-only; otherwise, false. 
IsSynchronized
Gets a value indicating whether access to the ICollection is synchronized (thread safe).
public bool IsSynchronized { get; }Property Value
- bool
- true if access to the ICollection is synchronized (thread safe); otherwise, false. 
this[TKey]
Gets the IEnumerable<T> sequence of values indexed by a specified key.
public IEnumerable<TValue> this[TKey key] { get; }Parameters
- keyTKey
- The key of the desired sequence of values. 
Property Value
- IEnumerable<TValue>
- The IEnumerable<T> sequence of values indexed by the specified key. 
Keys
public IEnumerable<TKey> Keys { get; }Property Value
- IEnumerable<TKey>
SyncRoot
Gets an object that can be used to synchronize access to the ICollection.
public object SyncRoot { get; }Property Value
- object
- An object that can be used to synchronize access to the ICollection. 
Values
public IEnumerable<TValue> Values { get; }Property Value
- IEnumerable<TValue>
Methods
Add(KeyValuePair<TKey, TValue>)
Adds an item to the ICollection<T>.
public void Add(KeyValuePair<TKey, TValue> item)Parameters
- itemKeyValuePair<TKey, TValue>
- The object to add to the ICollection<T>. 
Exceptions
- NotSupportedException
- The ICollection<T> is read-only. 
Add(object, object)
public void Add(object key, object value)Parameters
- keyobject
- valueobject
Add(TKey, TValue)
public void Add(TKey key, TValue value)Parameters
- keyTKey
- valueTValue
Contains(KeyValuePair<TKey, TValue>)
Determines whether the ICollection<T> contains a specific value.
public bool Contains(KeyValuePair<TKey, TValue> item)Parameters
- itemKeyValuePair<TKey, TValue>
- The object to locate in the ICollection<T>. 
Returns
- bool
- true if - itemis found in the ICollection<T>; otherwise, false.
Contains(object)
public bool Contains(object key)Parameters
- keyobject
Returns
Contains(TKey)
Determines whether a specified key exists in the ILookup<TKey, TElement>.
public bool Contains(TKey key)Parameters
- keyTKey
- The key to search for in the ILookup<TKey, TElement>. 
Returns
- bool
- true if - keyis in the ILookup<TKey, TElement>; otherwise, false.
ContainsKey(TKey)
public bool ContainsKey(TKey key)Parameters
- keyTKey
Returns
CopyTo(Array, int)
Copies the elements of the ICollection to an Array, starting at a particular Array index.
public void CopyTo(Array array, int index)Parameters
- arrayArray
- The one-dimensional Array that is the destination of the elements copied from ICollection. The Array must have zero-based indexing. 
- indexint
- The zero-based index in - arrayat which copying begins.
Exceptions
- ArgumentNullException
- arrayis null.
- ArgumentOutOfRangeException
- indexis less than zero.
- ArgumentException
- <code class="paramref">array</code> is multidimensional.- -or- - The number of elements in the source ICollection is greater than the available space from - indexto the end of the destination- array.- -or- - The type of the source ICollection cannot be cast automatically to the type of the destination - array.
CopyTo(KeyValuePair<TKey, TValue>[], int)
Copies the elements of the ICollection<T> to an Array, starting at a particular Array index.
public void CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex)Parameters
- arrayKeyValuePair<TKey, TValue>[]
- The one-dimensional Array that is the destination of the elements copied from ICollection<T>. The Array must have zero-based indexing. 
- arrayIndexint
- The zero-based index in - arrayat which copying begins.
Exceptions
- ArgumentNullException
- arrayis null.
- ArgumentOutOfRangeException
- arrayIndexis less than 0.
- ArgumentException
- The number of elements in the source ICollection<T> is greater than the available space from - arrayIndexto the end of the destination- array.
GetEnumerator()
Returns an enumerator that iterates through the collection.
public IEnumerator<IGrouping<TKey, TValue>> GetEnumerator()Returns
- IEnumerator<IGrouping<TKey, TValue>>
- An enumerator that can be used to iterate through the collection. 
Remove(KeyValuePair<TKey, TValue>)
Removes the first occurrence of a specific object from the ICollection<T>.
public bool Remove(KeyValuePair<TKey, TValue> item)Parameters
- itemKeyValuePair<TKey, TValue>
- The object to remove from the ICollection<T>. 
Returns
- bool
- true if - itemwas successfully removed from the ICollection<T>; otherwise, false. This method also returns false if- itemis not found in the original ICollection<T>.
Exceptions
- NotSupportedException
- The ICollection<T> is read-only. 
Remove(TKey)
public bool Remove(TKey key)Parameters
- keyTKey