Interface IImmutableValueSet<T>
- Namespace
- GuildWars2.Collections
- Assembly
- GuildWars2.dll
Represents an immutable set with value semantics for equality comparison.
[JsonConverter(typeof(ImmutableValueSetJsonConverterFactory))]
public interface IImmutableValueSet<T> : IImmutableSet<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable, IEquatable<IImmutableValueSet<T>>
Type Parameters
TThe type of elements in the set.
- Inherited Members
Remarks
This interface extends IImmutableSet<T> with value-based equality and covariant return types. The shadowed members return IImmutableValueSet<T> instead of IImmutableSet<T>, satisfying the Liskov Substitution Principle: the more specific return type is still assignable to the base type.
C# does not support return type covariance on interface implementations directly,
so member shadowing with the new keyword is used to achieve the same effect.
Methods
- Add(T)
Adds the specified element to this immutable set.
- Clear()
Retrieves an empty immutable set that has the same sorting and ordering semantics as this instance.
- Except(IEnumerable<T>)
Removes the elements in the specified collection from the current immutable set.
- Intersect(IEnumerable<T>)
Creates an immutable set that contains only elements that exist in this set and the specified set.
- Remove(T)
Removes the specified element from this immutable set.
- SymmetricExcept(IEnumerable<T>)
Creates an immutable set that contains only elements that are present either in the current set or in the specified collection, but not both.
- Union(IEnumerable<T>)
Creates a new immutable set that contains all elements that are present in either the current set or in the specified collection.