Initializes a new instance of the HashSet class that contains elements copied from the specified collection with the specified initial capacity and using the specified load factor, the specified hash code provider and the specified comparer.
[Visual Basic]
Overloads Public Sub New( _
ByVal collection As ICollection, _
ByVal initialCapacity As Integer, _
ByVal loadFactor As Single, _
ByVal hcp As IHashCodeProvider, _
ByVal comparer As IComparer _
)
-or-
Anull
reference (Nothing in Visual Basic) to use the default
hash code provider, which is each element's implementation of
GetHashCode.
-or-
Anull
reference (Nothing in Visual Basic) to use the default
comparer, which is each element's implementation of Equals.
Exception Type | Condition |
---|---|
System.ArgumentOutOfRangeException | capacity is less than zero.
-or- loadFactor is less than 0.1.-or- loadFactor is greater than 1.0. |
HashSet Class | HashSet Members | Foley.Utilities.Collections Namespace | HashSet Constructor Overload List