Table of Contents

Interface ISetComparable<T>

Namespace
PAC.Interfaces

Defines how to determine whether two sets are equal / one is a subset of the other.

public interface ISetComparable<T>

Type Parameters

T

The type to define set comparison against.

Extension Methods

Remarks

If T1 implements ISetComparable<T2> and T2 implements ISetComparable<T1>, it is up to implementers to ensure the logical symmetries of the methods. See the documentation of each method for more detail on these symmetries.

Methods

IsSubsetOf(T)

Whether this as a set is a subset of other as a set.

bool IsSubsetOf(T other)

Parameters

other T

Returns

bool

Remarks

Recall that 'this is subset of other' means that every element of this is an element of other, ignoring order and duplicate elements.

If T1 implements ISetComparable<T2> and T2 implements ISetComparable<T1>, then T1.IsSubsetOf(T2) should be logically equivalent to T2.IsSupersetOf(T1).

See Also

IsSupersetOf(T)

Whether this as a set is a superset of other as a set.

bool IsSupersetOf(T other)

Parameters

other T

Returns

bool

Remarks

Recall that 'this is superset of other' means that every element of other is an element of this, ignoring order and duplicate elements.

If T1 implements ISetComparable<T2> and T2 implements ISetComparable<T1>, then T1.IsSupersetOf(T2) should be logically equivalent to T2.IsSubsetOf(T1).

See Also

SetEquals(T)

Whether this as a set is equal to other as a set.

bool SetEquals(T other)

Parameters

other T

Returns

bool

Remarks

Recall that set equality means they have precisely the same elements, ignoring order and duplicate elements.

If T1 implements ISetComparable<T2> and T2 implements ISetComparable<T1>, then T1.SetEquals(T2) should be logically equivalent to T2.SetEquals(T1).