Class Set<T>
A collection of unique items.
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
public class Set<T> : ICollection<T>, ICloneable, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable
Type Parameters
Name |
Description |
T |
The item type.
|
Constructors
Set()
Declaration
Set(IEqualityComparer<T>)
Declaration
public Set(IEqualityComparer<T> comparer)
Parameters
Set(Int32, IEqualityComparer<T>)
Declaration
public Set(int capacity, IEqualityComparer<T> comparer)
Parameters
Properties
Capacity
Declaration
public int Capacity { get; set; }
Property Value
Comparer
Declaration
public IEqualityComparer<T> Comparer { get; }
Property Value
Count
Declaration
public virtual int Count { get; }
Property Value
IsReadOnly
Declaration
public virtual bool IsReadOnly { get; }
Property Value
Methods
Add(T)
Declaration
public virtual void Add(T item)
Parameters
Type |
Name |
Description |
T |
item |
|
AddRange(IEnumerable<T>)
Add all items in a collection.
Declaration
public void AddRange(IEnumerable<T> list)
Parameters
Clear()
Declaration
public virtual void Clear()
Clone()
Declaration
Returns
Contains(T)
Declaration
public virtual bool Contains(T item)
Parameters
Type |
Name |
Description |
T |
item |
|
Returns
Contains(IList<T>)
Test membership of all items in a collection.
Declaration
public IList<bool> Contains(IList<T> list)
Parameters
Type |
Name |
Description |
IList<T> |
list |
|
Returns
Type |
Description |
IList<Boolean> |
result[i] is true iff the set contains list[i].
|
ContainsAll(IEnumerable<T>)
Test membership of all items in a collection.
Declaration
public bool ContainsAll(IEnumerable<T> list)
Parameters
Returns
Type |
Description |
Boolean |
true if the set contains all items in list.
|
ContainsAny(IEnumerable<T>)
Test membership of all items in a collection.
Declaration
public bool ContainsAny(IEnumerable<T> list)
Parameters
Returns
Type |
Description |
Boolean |
true if the set contains any item in list.
|
ConvertAll(Converter<T, T>)
Declaration
public Set<T> ConvertAll(Converter<T, T> converter)
Parameters
Type |
Name |
Description |
Converter<T, T> |
converter |
|
Returns
CopyTo(T[], Int32)
Declaration
public virtual void CopyTo(T[] array, int index)
Parameters
Type |
Name |
Description |
T[] |
array |
|
Int32 |
index |
|
Difference(Set<T>, IEnumerable<T>)
Declaration
public static Set<T> Difference(Set<T> a, IEnumerable<T> b)
Parameters
Returns
Equals(Object)
Declaration
public override bool Equals(object that)
Parameters
Type |
Name |
Description |
Object |
that |
|
Returns
Overrides
Declaration
public static Set<T> FromEnumerable(IEnumerable<T> collection)
Parameters
Returns
Declaration
public static Set<T> FromEnumerable(IEqualityComparer<T> comparer, IEnumerable<T> collection)
Parameters
Returns
GetEnumerator()
Declaration
public virtual IEnumerator<T> GetEnumerator()
Returns
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Overrides
Intersection(Set<T>, IEnumerable<T>)
Declaration
public static Set<T> Intersection(Set<T> a, IEnumerable<T> b)
Parameters
Returns
IntersectWith(IEnumerable<T>)
Declaration
public void IntersectWith(IEnumerable<T> items)
Parameters
Remove(T)
Declaration
public virtual bool Remove(T item)
Parameters
Type |
Name |
Description |
T |
item |
|
Returns
Remove(IEnumerable<T>)
Remove all items in a collection.
Declaration
public void Remove(IEnumerable<T> list)
Parameters
ToString()
Declaration
public override string ToString()
Returns
Overrides
Union(Set<T>, Set<T>)
Declaration
public static Set<T> Union(Set<T> a, Set<T> b)
Parameters
Type |
Name |
Description |
Set<T> |
a |
|
Set<T> |
b |
|
Returns
Operators
Addition(Set<T>, Set<T>)
Declaration
public static Set<T> operator +(Set<T> a, Set<T> b)
Parameters
Type |
Name |
Description |
Set<T> |
a |
|
Set<T> |
b |
|
Returns
BitwiseAnd(Set<T>, IEnumerable<T>)
Declaration
public static Set<T> operator &(Set<T> a, IEnumerable<T> b)
Parameters
Returns
BitwiseOr(Set<T>, Set<T>)
Declaration
public static Set<T> operator |(Set<T> a, Set<T> b)
Parameters
Type |
Name |
Description |
Set<T> |
a |
|
Set<T> |
b |
|
Returns
Equality(Set<T>, Set<T>)
Declaration
public static bool operator ==(Set<T> a, Set<T> b)
Parameters
Type |
Name |
Description |
Set<T> |
a |
|
Set<T> |
b |
|
Returns
GreaterThan(Set<T>, Set<T>)
Declaration
public static bool operator>(Set<T> a, Set<T> b)
Parameters
Type |
Name |
Description |
Set<T> |
a |
|
Set<T> |
b |
|
Returns
GreaterThanOrEqual(Set<T>, Set<T>)
Declaration
public static bool operator >=(Set<T> a, Set<T> b)
Parameters
Type |
Name |
Description |
Set<T> |
a |
|
Set<T> |
b |
|
Returns
Type |
Description |
Boolean |
True iff a is equal to or a superset of b.
|
Inequality(Set<T>, Set<T>)
Declaration
public static bool operator !=(Set<T> a, Set<T> b)
Parameters
Type |
Name |
Description |
Set<T> |
a |
|
Set<T> |
b |
|
Returns
LessThan(Set<T>, Set<T>)
Declaration
public static bool operator <(Set<T> a, Set<T> b)
Parameters
Type |
Name |
Description |
Set<T> |
a |
|
Set<T> |
b |
|
Returns
LessThanOrEqual(Set<T>, Set<T>)
Declaration
public static bool operator <=(Set<T> a, Set<T> b)
Parameters
Type |
Name |
Description |
Set<T> |
a |
|
Set<T> |
b |
|
Returns
Type |
Description |
Boolean |
True iff a is equal to or a subset of b.
|
Subtraction(Set<T>, IEnumerable<T>)
Declaration
public static Set<T> operator -(Set<T> a, IEnumerable<T> b)
Parameters
Returns
Explicit Interface Implementations
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Implements
Extension Methods