Wintellect.PowerCollections Namespace
Algorithms Class
Algorithms Methods
GhostDoc Pro Sample Help File

Algorithms..::..IsSubsetOf<(Of <(<'T>)>)> Method (IEnumerable<(Of <(<'T>)>)>, IEnumerable<(Of <(<'T>)>)>, IEqualityComparer<(Of <(<'T>)>)>)

Determines if one collection is a subset of another, considered as sets. The first set is a subset of the second set if every item in the first set also occurs in the second set. If an item appears X times in the first set, it must appear at least X times in the second set.

Namespace:  Wintellect.PowerCollections
Assembly:  PowerCollections (in PowerCollections.dll)

Syntax


public static bool IsSubsetOf<T>(
	IEnumerable<T> collection1,
	IEnumerable<T> collection2,
	IEqualityComparer<T> equalityComparer
)
Public Shared Function IsSubsetOf(Of T) ( _
	collection1 As IEnumerable(Of T), _
	collection2 As IEnumerable(Of T), _
	equalityComparer As IEqualityComparer(Of T) _
) As Boolean
public:
generic<typename T>
static bool^ IsSubsetOf(
	IEnumerable<T>^ collection1, 
	IEnumerable<T>^ collection2, 
	IEqualityComparer<T>^ equalityComparer
)

Type Parameters

T

Parameters

collection1
Type: IEnumerable<(Of <(<'T>)>)>
The first collection.
collection2
Type: IEnumerable<(Of <(<'T>)>)>
The second collection.
equalityComparer
Type: IEqualityComparer<(Of <(<'T>)>)>
The IEqualityComparer<T> used to compare items for equality.

Return Value

True if collection1 is a subset of collection2, considered as sets.

Exceptions


ExceptionCondition
ArgumentNullExceptioncollection1 or collection2 is null.

Remarks


If both collections are Set, Bag, OrderedSet, or OrderedBag collections, it is more efficient to use the IsSubsetOf method on that class.