Foley .NET Utilities Class Library

HashSet Constructor (Int32, Single)

Creates an empty HashSet with the specified initial capacity and using the specified load factor, the default hash code provider and the default comparer.

[Visual Basic]
Overloads Public Sub New( _
   ByVal initialCapacity As Integer, _
   ByVal loadFactor As Single _
)
[C#]
public HashSet(
   int initialCapacity,
   float loadFactor
);

Parameters

initialCapacity
The approximate number of elements that the HashSet can initially contain.
loadFactor
A number in the range from 0.1 through 1.0 indicating the maximum ratio of elements to buckets.

Exceptions

Exception TypeCondition
System.ArgumentOutOfRangeExceptioncapacity is less than zero.

-or-

loadFactor is less than 0.1.

-or-

loadFactor is greater than 1.0.

See Also

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