Set

Description

class Tinman.Core.Collections.Set<T>

Derived from

BagBase<T> abstract
ISet<T>

An implementation of the IBag interface that uses a hashtable for storing the set elements.

A specialized container may be created by subclassing Set and specifying a suitable EqualsDelegate and a suitable HashCodeDelegate in the constructor, optionally overriding the following methods to provide custom semantics:

Public / Constructors

Copy


public static method Copy → (3)

values in : IBagConst<T>

The values to copy or null to create an empty set.

equals opt : EqualsDelegate<T> = null

The equality predicate. If null, IBagConst.MethodEquality of values in will be used, if possible. Otherwise, SystemUtil.EqualsDefault will be used.

hashCode opt : HashCodeDelegate<T> = null

The hashing method. If null, IBagConst.MethodHashCode of values in will be used, if possible. Otherwise, SystemUtil.HashCodeDefault will be used.

returns → Set<T>

The created Set object.

Copies the given values in into a compact Set.

Set

3 overloads


public constructor Set1 → (1)

capacity opt : int32 = 12

[>=0]
The initial capacity of the dictionary, in key/value pairs.

Creates a new instance of Set.

The equality delegate is SystemUtil.EqualsDefault.
The hash code delegate is SystemUtil.HashCodeDefault.


public constructor Set2 → (2)

equals in : EqualsDelegate<T>

Optional equality comparer. If null, SystemUtil.EqualsDefault will be used.

capacity opt : int32 = 12

[>=0]
The initial capacity of the dictionary, in key/value pairs.

Creates a new instance of Set.

The hash code delegate is SystemUtil.HashCodeDefault.


public constructor Set3 → (3)

equals in : EqualsDelegate<T>

Optional equality comparer. If null, SystemUtil.EqualsDefault will be used.

hashCode in : HashCodeDelegate<T>

Optional hash code delegate. If null, SystemUtil.HashCodeDefault will be used.

capacity opt : int32 = 12

[>=0]
The initial capacity of the dictionary, in key/value pairs.

Creates a new instance of Set.

Wrap


[Pure]
public static method Wrap → (3)

element in : T

The set element.

equals in : EqualsDelegate<T>

Optional equality comparer. If null, SystemUtil.EqualsDefault will be used.

hashCode in : HashCodeDelegate<T>

Optional hash code delegate. If null, SystemUtil.HashCodeDefault will be used.

returns → Set<T>

The set.

Creates a compact set that initially holds the given element.

Public / Methods

Clear​Dirty


public method ClearDirty → ()

Removes all elements from this collection, without setting the element values to their defaults.