Stride

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

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

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

    FastList<T> Class

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

    Similar to System.Collections.Generic.List<T>, with direct access to underlying array.

    System.Object → FastList<T>
    Derived from FastList<T>: RenderLightCollection

    [DataSerializer(typeof(ListAllSerializer<, >), Mode = DataSerializerGenericMode.TypeAndGenericArguments)]
    public class FastList<T> : IList<T>, IReadOnlyList<T>, IReadOnlyCollection<T>, ICollection<T>, IEnumerable<T>, IEnumerable
    Type Parameters
    Name Description
    T

    The type of elements in the list.

    Name Description
    Constructors
    FastList()
    FastList(IEnumerable<T>)
    FastList(Int32)
    Properties
    Capacity
    Count
    Item[Int32]
    Items

    Gets the items.

    Methods
    Add(T)
    AddRange(IEnumerable<T>)
    AsReadOnly()
    BinarySearch(T)
    BinarySearch(T, IComparer<T>)
    BinarySearch(Int32, Int32, T, IComparer<T>)
    Clear()
    Clear(Boolean)

    Clears this list with a fast-clear option.

    Contains(T)
    CopyTo(T[])
    CopyTo(T[], Int32)
    CopyTo(Int32, T[], Int32, Int32)
    EnsureCapacity(Int32)
    Exists(Predicate<T>)
    Find(Predicate<T>)
    FindAll(Predicate<T>)
    FindIndex(Int32, Int32, Predicate<T>)
    FindIndex(Int32, Predicate<T>)
    FindIndex(Predicate<T>)
    FindLast(Predicate<T>)
    FindLastIndex(Int32, Int32, Predicate<T>)
    FindLastIndex(Int32, Predicate<T>)
    FindLastIndex(Predicate<T>)
    ForEach(Action<T>)
    GetEnumerator()
    GetRange(Int32, Int32)
    IncreaseCapacity(Int32)
    IndexOf(T)
    IndexOf(T, Int32)
    IndexOf(T, Int32, Int32)
    Insert(Int32, T)
    InsertRange(Int32, IEnumerable<T>)
    LastIndexOf(T)
    LastIndexOf(T, Int32)
    LastIndexOf(T, Int32, Int32)
    Remove(T)
    RemoveAll(Predicate<T>)
    RemoveAt(Int32)
    RemoveRange(Int32, Int32)
    Resize(Int32, Boolean)
    Reverse()
    Reverse(Int32, Int32)
    Sort()
    Sort(IComparer<T>)
    Sort(Int32, Int32, IComparer<T>)
    ToArray()
    TrimExcess()
    TrueForAll(Predicate<T>)
    Explicit Interface Implementations
    ICollection<T>.IsReadOnly
    IEnumerable<T>.GetEnumerator()
    IEnumerable.GetEnumerator()
    | Improve this Doc View Source

    Constructors


    FastList()

    public FastList()

    FastList(IEnumerable<T>)

    public FastList(IEnumerable<T> collection)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<T> collection

    FastList(Int32)

    public FastList(int capacity)
    Parameters
    Type Name Description
    System.Int32 capacity
    | Improve this Doc View Source

    Properties


    Capacity

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

    Count

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

    Item[Int32]

    public T this[int index] { get; set; }
    Parameters
    Type Name Description
    System.Int32 index
    Property Value
    Type Description
    T

    Items

    Gets the items.

    public T[] Items { get; }
    Property Value
    Type Description
    T[]
    | Improve this Doc View Source

    Methods


    Add(T)

    public void Add(T item)
    Parameters
    Type Name Description
    T item

    AddRange(IEnumerable<T>)

    public void AddRange(IEnumerable<T> collection)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<T> collection

    AsReadOnly()

    public ReadOnlyCollection<T> AsReadOnly()
    Returns
    Type Description
    System.Collections.ObjectModel.ReadOnlyCollection<T>

    BinarySearch(T)

    public int BinarySearch(T item)
    Parameters
    Type Name Description
    T item
    Returns
    Type Description
    System.Int32

    BinarySearch(T, IComparer<T>)

    public int BinarySearch(T item, IComparer<T> comparer)
    Parameters
    Type Name Description
    T item
    System.Collections.Generic.IComparer<T> comparer
    Returns
    Type Description
    System.Int32

    BinarySearch(Int32, Int32, T, IComparer<T>)

    public int BinarySearch(int index, int count, T item, IComparer<T> comparer)
    Parameters
    Type Name Description
    System.Int32 index
    System.Int32 count
    T item
    System.Collections.Generic.IComparer<T> comparer
    Returns
    Type Description
    System.Int32

    Clear()

    public void Clear()

    Clear(Boolean)

    Clears this list with a fast-clear option.

    public void Clear(bool fastClear)
    Parameters
    Type Name Description
    System.Boolean fastClear

    if set to true this method only resets the count elements but doesn't clear items referenced already stored in the list.


    Contains(T)

    public bool Contains(T item)
    Parameters
    Type Name Description
    T item
    Returns
    Type Description
    System.Boolean

    CopyTo(T[])

    public void CopyTo(T[] array)
    Parameters
    Type Name Description
    T[] array

    CopyTo(T[], Int32)

    public void CopyTo(T[] array, int arrayIndex)
    Parameters
    Type Name Description
    T[] array
    System.Int32 arrayIndex

    CopyTo(Int32, T[], Int32, Int32)

    public void CopyTo(int index, T[] array, int arrayIndex, int count)
    Parameters
    Type Name Description
    System.Int32 index
    T[] array
    System.Int32 arrayIndex
    System.Int32 count

    EnsureCapacity(Int32)

    public void EnsureCapacity(int min)
    Parameters
    Type Name Description
    System.Int32 min

    Exists(Predicate<T>)

    public bool Exists(Predicate<T> match)
    Parameters
    Type Name Description
    System.Predicate<T> match
    Returns
    Type Description
    System.Boolean

    Find(Predicate<T>)

    public T Find(Predicate<T> match)
    Parameters
    Type Name Description
    System.Predicate<T> match
    Returns
    Type Description
    T

    FindAll(Predicate<T>)

    public FastList<T> FindAll(Predicate<T> match)
    Parameters
    Type Name Description
    System.Predicate<T> match
    Returns
    Type Description
    FastList<T>

    FindIndex(Int32, Int32, Predicate<T>)

    public int FindIndex(int startIndex, int count, Predicate<T> match)
    Parameters
    Type Name Description
    System.Int32 startIndex
    System.Int32 count
    System.Predicate<T> match
    Returns
    Type Description
    System.Int32

    FindIndex(Int32, Predicate<T>)

    public int FindIndex(int startIndex, Predicate<T> match)
    Parameters
    Type Name Description
    System.Int32 startIndex
    System.Predicate<T> match
    Returns
    Type Description
    System.Int32

    FindIndex(Predicate<T>)

    public int FindIndex(Predicate<T> match)
    Parameters
    Type Name Description
    System.Predicate<T> match
    Returns
    Type Description
    System.Int32

    FindLast(Predicate<T>)

    public T FindLast(Predicate<T> match)
    Parameters
    Type Name Description
    System.Predicate<T> match
    Returns
    Type Description
    T

    FindLastIndex(Int32, Int32, Predicate<T>)

    public int FindLastIndex(int startIndex, int count, Predicate<T> match)
    Parameters
    Type Name Description
    System.Int32 startIndex
    System.Int32 count
    System.Predicate<T> match
    Returns
    Type Description
    System.Int32

    FindLastIndex(Int32, Predicate<T>)

    public int FindLastIndex(int startIndex, Predicate<T> match)
    Parameters
    Type Name Description
    System.Int32 startIndex
    System.Predicate<T> match
    Returns
    Type Description
    System.Int32

    FindLastIndex(Predicate<T>)

    public int FindLastIndex(Predicate<T> match)
    Parameters
    Type Name Description
    System.Predicate<T> match
    Returns
    Type Description
    System.Int32

    ForEach(Action<T>)

    public void ForEach(Action<T> action)
    Parameters
    Type Name Description
    System.Action<T> action

    GetEnumerator()

    public FastList<T>.Enumerator GetEnumerator()
    Returns
    Type Description
    FastList.Enumerator<>

    GetRange(Int32, Int32)

    public FastList<T> GetRange(int index, int count)
    Parameters
    Type Name Description
    System.Int32 index
    System.Int32 count
    Returns
    Type Description
    FastList<T>

    IncreaseCapacity(Int32)

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

    IndexOf(T)

    public int IndexOf(T item)
    Parameters
    Type Name Description
    T item
    Returns
    Type Description
    System.Int32

    IndexOf(T, Int32)

    public int IndexOf(T item, int index)
    Parameters
    Type Name Description
    T item
    System.Int32 index
    Returns
    Type Description
    System.Int32

    IndexOf(T, Int32, Int32)

    public int IndexOf(T item, int index, int count)
    Parameters
    Type Name Description
    T item
    System.Int32 index
    System.Int32 count
    Returns
    Type Description
    System.Int32

    Insert(Int32, T)

    public void Insert(int index, T item)
    Parameters
    Type Name Description
    System.Int32 index
    T item

    InsertRange(Int32, IEnumerable<T>)

    public void InsertRange(int index, IEnumerable<T> collection)
    Parameters
    Type Name Description
    System.Int32 index
    System.Collections.Generic.IEnumerable<T> collection

    LastIndexOf(T)

    public int LastIndexOf(T item)
    Parameters
    Type Name Description
    T item
    Returns
    Type Description
    System.Int32

    LastIndexOf(T, Int32)

    public int LastIndexOf(T item, int index)
    Parameters
    Type Name Description
    T item
    System.Int32 index
    Returns
    Type Description
    System.Int32

    LastIndexOf(T, Int32, Int32)

    public int LastIndexOf(T item, int index, int count)
    Parameters
    Type Name Description
    T item
    System.Int32 index
    System.Int32 count
    Returns
    Type Description
    System.Int32

    Remove(T)

    public bool Remove(T item)
    Parameters
    Type Name Description
    T item
    Returns
    Type Description
    System.Boolean

    RemoveAll(Predicate<T>)

    public int RemoveAll(Predicate<T> match)
    Parameters
    Type Name Description
    System.Predicate<T> match
    Returns
    Type Description
    System.Int32

    RemoveAt(Int32)

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

    RemoveRange(Int32, Int32)

    public void RemoveRange(int index, int count)
    Parameters
    Type Name Description
    System.Int32 index
    System.Int32 count

    Resize(Int32, Boolean)

    public void Resize(int newSize, bool fastClear)
    Parameters
    Type Name Description
    System.Int32 newSize
    System.Boolean fastClear

    Reverse()

    public void Reverse()

    Reverse(Int32, Int32)

    public void Reverse(int index, int count)
    Parameters
    Type Name Description
    System.Int32 index
    System.Int32 count

    Sort()

    public void Sort()

    Sort(IComparer<T>)

    public void Sort(IComparer<T> comparer)
    Parameters
    Type Name Description
    System.Collections.Generic.IComparer<T> comparer

    Sort(Int32, Int32, IComparer<T>)

    public void Sort(int index, int count, IComparer<T> comparer)
    Parameters
    Type Name Description
    System.Int32 index
    System.Int32 count
    System.Collections.Generic.IComparer<T> comparer

    ToArray()

    public T[] ToArray()
    Returns
    Type Description
    T[]

    TrimExcess()

    public void TrimExcess()

    TrueForAll(Predicate<T>)

    public bool TrueForAll(Predicate<T> match)
    Parameters
    Type Name Description
    System.Predicate<T> match
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Explicit Interface Implementations


    ICollection<T>.IsReadOnly

    bool ICollection<T>.IsReadOnly { get; }
    Returns
    Type Description
    System.Boolean

    IEnumerable<T>.GetEnumerator()

    IEnumerator<T> IEnumerable<T>.GetEnumerator()
    Returns
    Type Description
    System.Collections.Generic.IEnumerator<T>

    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>)
    CollectionExtensions.SwapRemove<T>(IList<T>, T)
    CollectionExtensions.SwapRemoveAt<T>(IList<T>, Int32)
    CollectionExtensions.IndexOf<T>(IReadOnlyList<T>, 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