MetalamaAPI documentationAspect APIMetalama.​Framework.​OptionsIncremental­Hash­Set<T>
Open sandboxFocus

IncrementalHashSet<T> Class

An immutable hash set where each class instance does not represent the full set but a modification of another set (possibly empty). This class implements the IIncrementalObject interface and can be easily used in the context of an IHierarchicalOptions<T>. The class can represent the Add(T), Remove(T) and Clear<T>() operations.

Inheritance
IncrementalHashSet<T>
Namespace: Metalama.Framework.Options
Assembly: Metalama.Framework.dll
Syntax
public class IncrementalHashSet<T> : IIncrementalObject, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable, ICompileTimeSerializable where T : notnull
Type Parameters
Name Description
T

Type of items.

Constructors

Name Description
IncrementalHashSet(ImmutableDictionary<T, bool>, bool)

Properties

Name Description
Count

Gets the number of items in the current collection.

Empty

Gets an IncrementalHashSet<T> that represents the absence of any change in the collection.

IsEmpty

Methods

Name Description
Add(IEnumerable<T>)

Creates a new IncrementalHashSet<T> that represents the operation of adding items to the collection, additionally to any operation represented by the current collection.

Add(T)

Creates a new IncrementalHashSet<T> that represents the operation of adding an item to the collection, additionally to any operation represented by the current collection.

Add(T[])

Creates a new IncrementalHashSet<T> that represents the operation of adding items to the collection, additionally to any operation represented by the current collection.

ApplyChanges(IncrementalHashSet<T>, in ApplyChangesContext)

Overrides the current collection with another collection and returns the result.

Create(ImmutableDictionary<T, bool>, bool)
GetEnumerator()
Remove(IEnumerable<T>)

Creates a new IncrementalHashSet<T> that represents the option of removing a items from the , additionally to any operation represented by the current object.

Remove(T)

Creates a new IncrementalHashSet<T> that represents the option of removing an item from the collection, additionally to any operation represented by the current object.

Remove(T[])

Creates a new IncrementalHashSet<T> that represents the option of removing a items from the collection, additionally to any operation represented by the current object.

Extension Methods

IncrementalObjectExtensions.ApplyChanges<T>(T, T, in ApplyChangesContext)
IncrementalObjectExtensions.ApplyChangesSafe<T>(T?, T?, in ApplyChangesContext)
EnumerableExtensions.Cache<T>(IEnumerable<T>)
EnumerableExtensions.SelectManyRecursiveDistinct<T>(IEnumerable<T>, Func<T, IEnumerable<T>?>, IEqualityComparer<T>, bool)