Table of Contents

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>
Inherited Members
Extension Methods

Constructors

ReadOnlySet(ISet<T>)

Initialize new ReadOnlySet<T> instance.

public ReadOnlySet(ISet<T> set)

Parameters

set ISet<T>

ISet<T> to be wrapped.

Properties

Count

Get number of element.

public int Count { get; }

Property Value

int

Methods

Contains(T)

Check whether given element is contained in set or not.

public bool Contains(T element)

Parameters

element T

Element.

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 int

Index of position in array to put first copied element.

GetEnumerator()

Get enumerator to enumerate elements.

public IEnumerator<T> GetEnumerator()

Returns

IEnumerator<T>

IEnumerator<T>.

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.