Class ReadOnlySet<T>
- Namespace
- CarinaStudio.Collections
- Assembly
- CarinaStudio.AppBase.Core.dll
Read-only ISet<T>.
public class ReadOnlySet<T> : ISet<T>, ICollection<T>, IReadOnlySet<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable
Type Parameters
T
Type of element.
- Inheritance
-
ReadOnlySet<T>
- Implements
-
ISet<T>ICollection<T>IReadOnlySet<T>IEnumerable<T>
- Inherited Members
- Extension Methods
Constructors
ReadOnlySet(ISet<T>)
Initialize new ReadOnlySet<T> instance.
public ReadOnlySet(ISet<T> set)
Parameters
Properties
Count
Get number of element.
public int Count { get; }
Property Value
Methods
Contains(T)
Check whether given element is contained in set or not.
public bool Contains(T element)
Parameters
element
TElement.
Returns
- bool
True if element is contained in set.
CopyTo(T[], int)
Copy elements.
public void CopyTo(T[] array, int arrayIndex)
Parameters
array
T[]Array to receive elements.
arrayIndex
intIndex of position in
array
to put first copied element.
GetEnumerator()
Get enumerator to enumerate elements.
public IEnumerator<T> GetEnumerator()
Returns
IsEmpty()
Check whether the set is empty or not.
public bool IsEmpty()
Returns
- bool
True if the set is empty.
IsNotEmpty()
Check whether the set is not empty or not.
public bool IsNotEmpty()
Returns
- bool
True if the set is not empty.
IsProperSubsetOf(IEnumerable<T>)
Check whether the set is proper (strict) subset of given collection or not.
public bool IsProperSubsetOf(IEnumerable<T> other)
Parameters
other
IEnumerable<T>Given collection.
Returns
- bool
True if the set is proper (strict) subset of given collection.
IsProperSupersetOf(IEnumerable<T>)
Check whether the set is proper (strict) superset of given collection or not.
public bool IsProperSupersetOf(IEnumerable<T> other)
Parameters
other
IEnumerable<T>Given collection.
Returns
- bool
True if the set is proper (strict) superset of given collection.
IsSubsetOf(IEnumerable<T>)
Check whether the set is subset of given collection or not.
public bool IsSubsetOf(IEnumerable<T> other)
Parameters
other
IEnumerable<T>Given collection.
Returns
- bool
True if the set is subset of given collection.
IsSupersetOf(IEnumerable<T>)
Check whether the set is superset of given collection or not.
public bool IsSupersetOf(IEnumerable<T> other)
Parameters
other
IEnumerable<T>Given collection.
Returns
- bool
True if the set is superset of given collection.
Overlaps(IEnumerable<T>)
Check whether the set overlaps with given collection or not.
public bool Overlaps(IEnumerable<T> other)
Parameters
other
IEnumerable<T>Given collection.
Returns
- bool
True if the set overlaps with given collection.
SetEquals(IEnumerable<T>)
Check whether the set contains same elements as given collection or not.
public bool SetEquals(IEnumerable<T> other)
Parameters
other
IEnumerable<T>Given collection.
Returns
- bool
True if the set contains same elements as given collection.