Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    SortedList<TKey, TValue> Class

    Namespace: Stride.Core.Collections
    Assembly: Stride.Core.dll

    Represents a collection of associated keys and values that are sorted by the keys and are accessible by key and by index.

    System.Object → SortedList<TKey, TValue>
    Derived from SortedList<TKey, TValue>:

    public class SortedList<TKey, TValue> : IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IDictionary, ICollection, IEnumerable
    Type Parameters
    Name Description
    TKey
    TValue
    Name Description
    Constructors
    SortedList()
    SortedList(IComparer<TKey>)
    SortedList(IDictionary<TKey, TValue>)
    SortedList(IDictionary<TKey, TValue>, IComparer<TKey>)
    SortedList(Int32)
    SortedList(Int32, IComparer<TKey>)
    Properties
    Capacity
    Comparer
    Count
    Item[TKey]
    Keys
    Values
    Methods
    Add(TKey, TValue)
    Clear()
    ContainsKey(TKey)
    ContainsValue(TValue)
    GetEnumerator()
    IndexOfKey(TKey)
    IndexOfValue(TValue)
    Remove(TKey)
    RemoveAt(Int32)
    TrimExcess()
    TryGetValue(TKey, out TValue)
    Explicit Interface Implementations
    ICollection<KeyValuePair<TKey, TValue>>.Add(KeyValuePair<TKey, TValue>)
    ICollection<KeyValuePair<TKey, TValue>>.Clear()
    ICollection<KeyValuePair<TKey, TValue>>.Contains(KeyValuePair<TKey, TValue>)
    ICollection<KeyValuePair<TKey, TValue>>.CopyTo(KeyValuePair<TKey, TValue>[], Int32)
    ICollection<KeyValuePair<TKey, TValue>>.IsReadOnly
    ICollection<KeyValuePair<TKey, TValue>>.Remove(KeyValuePair<TKey, TValue>)
    IDictionary<TKey, TValue>.Keys
    IDictionary<TKey, TValue>.Values
    IEnumerable<KeyValuePair<TKey, TValue>>.GetEnumerator()
    ICollection.CopyTo(Array, Int32)
    ICollection.IsSynchronized
    ICollection.SyncRoot
    IDictionary.Add(Object, Object)
    IDictionary.Contains(Object)
    IDictionary.GetEnumerator()
    IDictionary.IsFixedSize
    IDictionary.IsReadOnly
    IDictionary.Item[Object]
    IDictionary.Keys
    IDictionary.Remove(Object)
    IDictionary.Values
    IEnumerable.GetEnumerator()
    | Improve this Doc View Source

    Constructors


    SortedList()

    public SortedList()

    SortedList(IComparer<TKey>)

    public SortedList(IComparer<TKey> comparer)
    Parameters
    Type Name Description
    System.Collections.Generic.IComparer<TKey> comparer

    SortedList(IDictionary<TKey, TValue>)

    public SortedList(IDictionary<TKey, TValue> dictionary)
    Parameters
    Type Name Description
    System.Collections.Generic.IDictionary<TKey, TValue> dictionary

    SortedList(IDictionary<TKey, TValue>, IComparer<TKey>)

    public SortedList(IDictionary<TKey, TValue> dictionary, IComparer<TKey> comparer)
    Parameters
    Type Name Description
    System.Collections.Generic.IDictionary<TKey, TValue> dictionary
    System.Collections.Generic.IComparer<TKey> comparer

    SortedList(Int32)

    public SortedList(int capacity)
    Parameters
    Type Name Description
    System.Int32 capacity

    SortedList(Int32, IComparer<TKey>)

    public SortedList(int capacity, IComparer<TKey> comparer)
    Parameters
    Type Name Description
    System.Int32 capacity
    System.Collections.Generic.IComparer<TKey> comparer
    | Improve this Doc View Source

    Properties


    Capacity

    public int Capacity { get; set; }
    Property Value
    Type Description
    System.Int32

    Comparer

    public IComparer<TKey> Comparer { get; }
    Property Value
    Type Description
    System.Collections.Generic.IComparer<TKey>

    Count

    public int Count { get; }
    Property Value
    Type Description
    System.Int32

    Item[TKey]

    public TValue this[TKey key] { get; set; }
    Parameters
    Type Name Description
    TKey key
    Property Value
    Type Description
    TValue

    Keys

    public IList<TKey> Keys { get; }
    Property Value
    Type Description
    System.Collections.Generic.IList<TKey>

    Values

    public IList<TValue> Values { get; }
    Property Value
    Type Description
    System.Collections.Generic.IList<TValue>
    | Improve this Doc View Source

    Methods


    Add(TKey, TValue)

    public void Add(TKey key, TValue value)
    Parameters
    Type Name Description
    TKey key
    TValue value

    Clear()

    public void Clear()

    ContainsKey(TKey)

    public bool ContainsKey(TKey key)
    Parameters
    Type Name Description
    TKey key
    Returns
    Type Description
    System.Boolean

    ContainsValue(TValue)

    public bool ContainsValue(TValue value)
    Parameters
    Type Name Description
    TValue value
    Returns
    Type Description
    System.Boolean

    GetEnumerator()

    public SortedList<TKey, TValue>.Enumerator GetEnumerator()
    Returns
    Type Description
    SortedList.Enumerator<>

    IndexOfKey(TKey)

    public int IndexOfKey(TKey key)
    Parameters
    Type Name Description
    TKey key
    Returns
    Type Description
    System.Int32

    IndexOfValue(TValue)

    public int IndexOfValue(TValue value)
    Parameters
    Type Name Description
    TValue value
    Returns
    Type Description
    System.Int32

    Remove(TKey)

    public bool Remove(TKey key)
    Parameters
    Type Name Description
    TKey key
    Returns
    Type Description
    System.Boolean

    RemoveAt(Int32)

    public void RemoveAt(int index)
    Parameters
    Type Name Description
    System.Int32 index

    TrimExcess()

    public void TrimExcess()

    TryGetValue(TKey, out TValue)

    public bool TryGetValue(TKey key, out TValue value)
    Parameters
    Type Name Description
    TKey key
    TValue value
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Explicit Interface Implementations


    ICollection<KeyValuePair<TKey, TValue>>.Add(KeyValuePair<TKey, TValue>)

    void ICollection<KeyValuePair<TKey, TValue>>.Add(KeyValuePair<TKey, TValue> keyValuePair)
    Parameters
    Type Name Description
    System.Collections.Generic.KeyValuePair<TKey, TValue> keyValuePair

    ICollection<KeyValuePair<TKey, TValue>>.Clear()

    void ICollection<KeyValuePair<TKey, TValue>>.Clear()

    ICollection<KeyValuePair<TKey, TValue>>.Contains(KeyValuePair<TKey, TValue>)

    bool ICollection<KeyValuePair<TKey, TValue>>.Contains(KeyValuePair<TKey, TValue> keyValuePair)
    Parameters
    Type Name Description
    System.Collections.Generic.KeyValuePair<TKey, TValue> keyValuePair
    Returns
    Type Description
    System.Boolean

    ICollection<KeyValuePair<TKey, TValue>>.CopyTo(KeyValuePair<TKey, TValue>[], Int32)

    void ICollection<KeyValuePair<TKey, TValue>>.CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex)
    Parameters
    Type Name Description
    System.Collections.Generic.KeyValuePair<TKey, TValue>[] array
    System.Int32 arrayIndex

    ICollection<KeyValuePair<TKey, TValue>>.IsReadOnly

    bool ICollection<KeyValuePair<TKey, TValue>>.IsReadOnly { get; }
    Returns
    Type Description
    System.Boolean

    ICollection<KeyValuePair<TKey, TValue>>.Remove(KeyValuePair<TKey, TValue>)

    bool ICollection<KeyValuePair<TKey, TValue>>.Remove(KeyValuePair<TKey, TValue> keyValuePair)
    Parameters
    Type Name Description
    System.Collections.Generic.KeyValuePair<TKey, TValue> keyValuePair
    Returns
    Type Description
    System.Boolean

    IDictionary<TKey, TValue>.Keys

    ICollection<TKey> IDictionary<TKey, TValue>.Keys { get; }
    Returns
    Type Description
    System.Collections.Generic.ICollection<TKey>

    IDictionary<TKey, TValue>.Values

    ICollection<TValue> IDictionary<TKey, TValue>.Values { get; }
    Returns
    Type Description
    System.Collections.Generic.ICollection<TValue>

    IEnumerable<KeyValuePair<TKey, TValue>>.GetEnumerator()

    IEnumerator<KeyValuePair<TKey, TValue>> IEnumerable<KeyValuePair<TKey, TValue>>.GetEnumerator()
    Returns
    Type Description
    System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<TKey, TValue>>

    ICollection.CopyTo(Array, Int32)

    void ICollection.CopyTo(Array array, int arrayIndex)
    Parameters
    Type Name Description
    System.Array array
    System.Int32 arrayIndex

    ICollection.IsSynchronized

    bool ICollection.IsSynchronized { get; }
    Returns
    Type Description
    System.Boolean

    ICollection.SyncRoot

    object ICollection.SyncRoot { get; }
    Returns
    Type Description
    System.Object

    IDictionary.Add(Object, Object)

    void IDictionary.Add(object key, object value)
    Parameters
    Type Name Description
    System.Object key
    System.Object value

    IDictionary.Contains(Object)

    bool IDictionary.Contains(object key)
    Parameters
    Type Name Description
    System.Object key
    Returns
    Type Description
    System.Boolean

    IDictionary.GetEnumerator()

    IDictionaryEnumerator IDictionary.GetEnumerator()
    Returns
    Type Description
    System.Collections.IDictionaryEnumerator

    IDictionary.IsFixedSize

    bool IDictionary.IsFixedSize { get; }
    Returns
    Type Description
    System.Boolean

    IDictionary.IsReadOnly

    bool IDictionary.IsReadOnly { get; }
    Returns
    Type Description
    System.Boolean

    IDictionary.Item[Object]

    object IDictionary.this[object key] { get; set; }
    Parameters
    Type Name Description
    System.Object key
    Returns
    Type Description
    System.Object

    IDictionary.Keys

    ICollection IDictionary.Keys { get; }
    Returns
    Type Description
    System.Collections.ICollection

    IDictionary.Remove(Object)

    void IDictionary.Remove(object key)
    Parameters
    Type Name Description
    System.Object key

    IDictionary.Values

    ICollection IDictionary.Values { get; }
    Returns
    Type Description
    System.Collections.ICollection

    IEnumerable.GetEnumerator()

    IEnumerator IEnumerable.GetEnumerator()
    Returns
    Type Description
    System.Collections.IEnumerator

    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    ArrayExtensions.ComputeHash<T>(ICollection<T>, IEqualityComparer<T>)
    EnumerableExtensions.IsNullOrEmpty(IEnumerable)
    EnumerableExtensions.ForEach<T>(IEnumerable, Action<T>)
    EnumerableExtensions.ForEach<T>(IEnumerable<T>, Action<T>)
    EnumerableExtensions.IndexOf<T>(IEnumerable<T>, Func<T, Boolean>)
    EnumerableExtensions.LastIndexOf<T>(IEnumerable<T>, Func<T, Boolean>)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation