Stride

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

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

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

    TrackingHashSet<T> Class

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

    Represents a hash set that generates events when items get added or removed.

    System.Object → TrackingHashSet<T>
    Derived from TrackingHashSet<T>:

    public class TrackingHashSet<T> : ISet<T>, ICollection<T>, IReadOnlySet<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable, ITrackingCollectionChanged
    Type Parameters
    Name Description
    T

    The type of elements in the hash set.

    Remarks

    Underlying storage is done with a System.Collections.Generic.HashSet<T>.

    Name Description
    Properties
    Count
    IsReadOnly
    Methods
    Add(T)
    Clear()
    Contains(T)

    Determines whether the set [contains] [the specified item].

    CopyTo(T[], Int32)
    ExceptWith(IEnumerable<T>)
    GetEnumerator()
    IntersectWith(IEnumerable<T>)
    IsProperSubsetOf(IEnumerable<T>)
    IsProperSupersetOf(IEnumerable<T>)
    IsSubsetOf(IEnumerable<T>)
    IsSupersetOf(IEnumerable<T>)
    Overlaps(IEnumerable<T>)
    Remove(T)
    SetEquals(IEnumerable<T>)
    SymmetricExceptWith(IEnumerable<T>)
    UnionWith(IEnumerable<T>)
    Events
    CollectionChanged

    Occurs when [collection changed].

    Explicit Interface Implementations
    ICollection<T>.Add(T)
    IEnumerable<T>.GetEnumerator()
    IEnumerable.GetEnumerator()
    | Improve this Doc View Source

    Properties


    Count

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

    IsReadOnly

    public bool IsReadOnly { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Methods


    Add(T)

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

    Clear()

    public void Clear()

    Contains(T)

    Determines whether the set [contains] [the specified item].

    public bool Contains(T item)
    Parameters
    Type Name Description
    T item

    The item.

    Returns
    Type Description
    System.Boolean

    true if the set [contains] [the specified item]; otherwise, false.


    CopyTo(T[], Int32)

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

    ExceptWith(IEnumerable<T>)

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

    GetEnumerator()

    public HashSet<T>.Enumerator GetEnumerator()
    Returns
    Type Description
    System.Collections.Generic.HashSet.Enumerator<>

    IntersectWith(IEnumerable<T>)

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

    IsProperSubsetOf(IEnumerable<T>)

    public bool IsProperSubsetOf(IEnumerable<T> other)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<T> other
    Returns
    Type Description
    System.Boolean

    IsProperSupersetOf(IEnumerable<T>)

    public bool IsProperSupersetOf(IEnumerable<T> other)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<T> other
    Returns
    Type Description
    System.Boolean

    IsSubsetOf(IEnumerable<T>)

    public bool IsSubsetOf(IEnumerable<T> other)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<T> other
    Returns
    Type Description
    System.Boolean

    IsSupersetOf(IEnumerable<T>)

    public bool IsSupersetOf(IEnumerable<T> other)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<T> other
    Returns
    Type Description
    System.Boolean

    Overlaps(IEnumerable<T>)

    public bool Overlaps(IEnumerable<T> other)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<T> other
    Returns
    Type Description
    System.Boolean

    Remove(T)

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

    SetEquals(IEnumerable<T>)

    public bool SetEquals(IEnumerable<T> other)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<T> other
    Returns
    Type Description
    System.Boolean

    SymmetricExceptWith(IEnumerable<T>)

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

    UnionWith(IEnumerable<T>)

    public void UnionWith(IEnumerable<T> other)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<T> other
    | Improve this Doc View Source

    Events


    CollectionChanged

    Occurs when [collection changed].

    public event EventHandler<TrackingCollectionChangedEventArgs> CollectionChanged
    Event Type
    Type Description
    System.EventHandler<TrackingCollectionChangedEventArgs>
    | Improve this Doc View Source

    Explicit Interface Implementations


    ICollection<T>.Add(T)

    void ICollection<T>.Add(T item)
    Parameters
    Type Name Description
    T item

    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>)
    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