Constructor TreeSet
TreeSet(MemoryType)
Create a red-black tree collection with natural comparer and item equalityComparer. We assume that if
T
is comparable, its default equalityComparer
will be compatible with the comparer.
Declaration
public TreeSet(MemoryType memoryType = MemoryType.Normal)
Parameters
Type | Name | Description |
---|---|---|
MemoryType | memoryType |
Exceptions
Type | Condition |
---|---|
NotComparableException | If is not comparable.
|
TreeSet(Collections.Generic.IComparer<T>, MemoryType)
Create a red-black tree collection with an external comparer.
The itemequalityComparer will be a compatible C5.ComparerZeroHashCodeEqualityComparer`1 since the default equalityComparer for T (C5.EqualityComparer`1.Default) is unlikely to be compatible with the external comparer. This makes the tree inadequate for use as item in a collection of unsequenced or sequenced sets or bags (C5.ICollection`1 and C5.ISequenced`1)
Declaration
public TreeSet(Collections.Generic.IComparer<T> comparer, MemoryType memoryType = MemoryType.Normal)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IComparer<T> | comparer | The external comparer |
MemoryType | memoryType |
TreeSet(Collections.Generic.IComparer<T>, Collections.Generic.IEqualityComparer<T>, MemoryType)
Create a red-black tree collection with an external comparer and an external item equalityComparer, assumed consistent.
Declaration
public TreeSet(Collections.Generic.IComparer<T> comparer, Collections.Generic.IEqualityComparer<T> equalityComparer, MemoryType memoryType = MemoryType.Normal)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IComparer<T> | comparer | The external comparer |
System.Collections.Generic.IEqualityComparer<T> | equalityComparer | The external item equalitySCG.Comparer |
MemoryType | memoryType |