Skip to main content

HashSet<T> Class

Namespace: System.Collections.Generic · Assembly: GHIElectronics.TinyCLR.Collections

Hash-table-based generic set. Mirrors the .NET BCL surface for the subset we ship. Same chained-collision layout and prime-table sizing as Dictionary{TKey, TValue}; the entry holds the element directly instead of a key/value pair. null IS a valid element when T is a reference type — the comparer (EqualityComparer{T}.Default) treats null consistently (GetHashCode(null) = 0, Equals(null, null) = true).

public class HashSet<T> : ISet<T>, ICollection<T>, IEnumerable<T>, ICollection, IEnumerable

Constructors

HashSet()

public HashSet() : this(0, null)

No description available.

HashSet(IEqualityComparer<T> comparer)

public HashSet(IEqualityComparer<T> comparer) : this(0, comparer)

No description available.

ParameterTypeDescription
comparerIEqualityComparer<T>

HashSet(int capacity)

public HashSet(int capacity) : this(capacity, null)

No description available.

ParameterTypeDescription
capacityint

HashSet(int capacity, IEqualityComparer<T> comparer)

public HashSet(int capacity, IEqualityComparer<T> comparer)

No description available.

ParameterTypeDescription
capacityint
comparerIEqualityComparer<T>

HashSet(IEnumerable<T> collection)

public HashSet(IEnumerable<T> collection) : this(collection, null)

No description available.

ParameterTypeDescription
collectionIEnumerable<T>

HashSet(IEnumerable<T> collection, IEqualityComparer<T> comparer)

public HashSet(IEnumerable<T> collection, IEqualityComparer<T> comparer) : this(0, comparer)

No description available.

ParameterTypeDescription
collectionIEnumerable<T>
comparerIEqualityComparer<T>

Properties

Comparer

public IEqualityComparer<T> Comparer { get; }

No description available.

Count

public int Count { get; }

Gets the number of elements contained in the array. (inherited)

Methods

Add(T item)

public bool Add(T item)

Appends a UIElement to the end of the UIElementCollection. (inherited)

ParameterTypeDescription
itemT

Returns bool — The UIElementCollection index at which the UIElement has been added.

Clear()

public void Clear()

Removes all elements from the UIElementCollection. (inherited)

Contains(T item)

public bool Contains(T item)

Determines whether a element is in the UIElementCollection. (inherited)

ParameterTypeDescription
itemT

Returns bool

Remove(T item)

public bool Remove(T item)

Removes the specified element from the UIElementCollection. (inherited)

ParameterTypeDescription
itemT

Returns bool

RemoveWhere(Predicate<T> match)

public int RemoveWhere(Predicate<T> match)

No description available.

ParameterTypeDescription
matchPredicate<T>

Returns int

TryGetValue(T equalValue, out T actualValue)

public bool TryGetValue(T equalValue, out T actualValue)

No description available.

ParameterTypeDescription
equalValueT
actualValueout T

Returns bool

CopyTo(T[] array)

public void CopyTo(T[] array)

No description available.

ParameterTypeDescription
arrayT[]

CopyTo(T[] array, int arrayIndex)

public void CopyTo(T[] array, int arrayIndex)

Strongly typed version of CopyTo Copies the collection into the Array. (inherited)

ParameterTypeDescription
arrayT[]
arrayIndexint

CopyTo(T[] array, int arrayIndex, int count)

public void CopyTo(T[] array, int arrayIndex, int count)

No description available.

ParameterTypeDescription
arrayT[]
arrayIndexint
countint

UnionWith(IEnumerable<T> other)

public void UnionWith(IEnumerable<T> other)

No description available.

ParameterTypeDescription
otherIEnumerable<T>

IntersectWith(IEnumerable<T> other)

public void IntersectWith(IEnumerable<T> other)

No description available.

ParameterTypeDescription
otherIEnumerable<T>

ExceptWith(IEnumerable<T> other)

public void ExceptWith(IEnumerable<T> other)

No description available.

ParameterTypeDescription
otherIEnumerable<T>

SymmetricExceptWith(IEnumerable<T> other)

public void SymmetricExceptWith(IEnumerable<T> other)

No description available.

ParameterTypeDescription
otherIEnumerable<T>

IsSubsetOf(IEnumerable<T> other)

public bool IsSubsetOf(IEnumerable<T> other)

No description available.

ParameterTypeDescription
otherIEnumerable<T>

Returns bool

IsProperSubsetOf(IEnumerable<T> other)

public bool IsProperSubsetOf(IEnumerable<T> other)

No description available.

ParameterTypeDescription
otherIEnumerable<T>

Returns bool

IsSupersetOf(IEnumerable<T> other)

public bool IsSupersetOf(IEnumerable<T> other)

No description available.

ParameterTypeDescription
otherIEnumerable<T>

Returns bool

IsProperSupersetOf(IEnumerable<T> other)

public bool IsProperSupersetOf(IEnumerable<T> other)

No description available.

ParameterTypeDescription
otherIEnumerable<T>

Returns bool

Overlaps(IEnumerable<T> other)

public bool Overlaps(IEnumerable<T> other)

No description available.

ParameterTypeDescription
otherIEnumerable<T>

Returns bool

SetEquals(IEnumerable<T> other)

public bool SetEquals(IEnumerable<T> other)

No description available.

ParameterTypeDescription
otherIEnumerable<T>

Returns bool

GetEnumerator()

public Enumerator GetEnumerator()

No description available.

Returns Enumerator