Foley .NET Utilities Class Library

HashSet.Contains Method (Object)

Determines whether an Object is in the HashSet.

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

Parameters

value
The Object to locate in the HashSet. The Object to locate can be a null reference (Nothing in Visual Basic).

Return Value

true if value is 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 value is a null reference (Nothing in Visual Basic).

See Also

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