Constructor EquatableSet
EquatableSet()
Initializes a new instance of the EquatableSet<T> class that is empty and has the default initial capacity.
Declaration
public EquatableSet()
EquatableSet(ISet<T>, Boolean)
Initializes a new instance of EquatableSet<T>.
If the wrap
parameter is true
, the
collection
is used as is without doing
a copy operation. Otherwise, the collection is copied
(which is the same operation as the
EquatableSet(ICollection<T>) overload).
The internal collection
is used for
all operations except for Equals(Object), GetHashCode(),
and ToString(), which are all based on deep analysis
of this collection and any nested collections.
Declaration
public EquatableSet(ISet<T> collection, bool wrap)
Parameters
Type | Name | Description |
---|---|---|
ISet<T> | collection | The collection that will either be wrapped or copied
depending on the value of |
System.Boolean | wrap |
|
EquatableSet(ICollection<T>)
Initializes a new instance of the EquatableSet<T> class that contains elements copied from the specified collection and has sufficient capacity to accommodate the number of elements copied.
Declaration
public EquatableSet(ICollection<T> collection)
Parameters
Type | Name | Description |
---|---|---|
ICollection<T> | collection | The collection whose elements are copied to the new set. |
EquatableSet(IEqualityComparer<T>)
Initializes a new instance of the EquatableSet<T> class that is empty and uses the specified equality comparer for the set type.
Declaration
public EquatableSet(IEqualityComparer<T> comparer)
Parameters
Type | Name | Description |
---|---|---|
IEqualityComparer<T> | comparer | The |
EquatableSet(IEnumerable<T>, IEqualityComparer<T>)
Initializes a new instance of the EquatableSet<T> class that uses the specified equality comparer for the set type, contains elements copied from the specified collection, and has sufficient capacity to accommodate the number of elements copied.
Declaration
public EquatableSet(IEnumerable<T> collection, IEqualityComparer<T> comparer)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | collection | The collection whose elements are copied to the new set. |
IEqualityComparer<T> | comparer | The |