Foley .NET Utilities Class Library

HashSet.Contains Method (ICollection)

Determines whether all the elements in the specified collection are contained in the HashSet.

[Visual Basic]
Overrides Overloads Public Function Contains( _
   ByVal collection As ICollection _
) As Boolean Implements _
   ISet.Contains
[C#]
public override bool Contains(
   ICollection collection
);

Parameters

collection
The ICollection whose elements are to be added to the end of the HashSet.

Return Value

true if all the elements of the ICollection are found in the HashSet; otherwise, false.

Implements

ISet.Contains

Remarks

This implementation is close to O(1) in most cases.

Exceptions

Exception TypeCondition
System.ArgumentNullException The collection is a null reference (Nothing in Visual Basic).

See Also

HashSet Class | HashSet Members | Foley.Utilities.Collections Namespace | HashSet.Contains Overload List