Class ImmutableValueSet<T>
- Namespace
- GuildWars2.Collections
- Assembly
- GuildWars2.dll
Represents an immutable set collection with value semantics, meaning two ImmutableValueSet<T> instances are considered equal if their contents are equal.
[JsonConverter(typeof(ImmutableValueSetJsonConverter))]
[SuppressMessage("Style", "IDE0028", Justification = "Cannot simplify constructor calls that wrap ImmutableHashSet<T>.")]
[SuppressMessage("Style", "IDE0301", Justification = "Cannot simplify to collection expression.")]
[SuppressMessage("Style", "IDE0303", Justification = "Cannot simplify to collection expression.")]
public sealed class ImmutableValueSet<T> : IImmutableValueSet<T>, IImmutableSet<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable, IEquatable<IImmutableValueSet<T>>
Type Parameters
TThe type of elements in the set.
- Inheritance
-
ImmutableValueSet<T>
- Implements
-
IEnumerable<T>
- Inherited Members
Constructors
- ImmutableValueSet()
Initializes a new instance of the ImmutableValueSet<T> class that is empty.
- ImmutableValueSet(IEnumerable<T>)
Initializes a new instance of the ImmutableValueSet<T> class that contains elements copied from the specified collection.
Properties
- Empty
Gets an empty ImmutableValueSet<T>.
Methods
- Add(T)
Creates a new ImmutableValueSet<T> with the specified item added.
- Clear()
Creates a new ImmutableValueSet<T> with all items removed.
- Contains(T)
Determines whether the set contains the specified value.
- Create(ReadOnlySpan<T>)
Creates an ImmutableValueSet<T> from a span of values. Used by collection expressions.
- Equals(IImmutableValueSet<T>?)
Determines whether the current ImmutableValueSet<T> is equal to another IImmutableValueSet<T> based on value semantics.
- Except(IEnumerable<T>)
Creates a new ImmutableValueSet<T> that contains elements in this set but not in the specified collection.
- GetHashCode()
Returns a hash code based on the values of the items in the set.
- Intersect(IEnumerable<T>)
Creates a new ImmutableValueSet<T> that is the intersection of this set and the specified collection.
- IsProperSubsetOf(IEnumerable<T>)
Determines whether this set is a proper subset of the specified collection.
- IsProperSupersetOf(IEnumerable<T>)
Determines whether this set is a proper superset of the specified collection.
- IsSubsetOf(IEnumerable<T>)
Determines whether this set is a subset of the specified collection.
- IsSupersetOf(IEnumerable<T>)
Determines whether this set is a superset of the specified collection.
- Overlaps(IEnumerable<T>)
Determines whether this set and the specified collection share any common elements.
- Remove(T)
Creates a new ImmutableValueSet<T> with the specified item removed.
- SetEquals(IEnumerable<T>)
Determines whether this set and the specified collection contain the same elements.
- SymmetricExcept(IEnumerable<T>)
Creates a new ImmutableValueSet<T> that contains elements present in either this set or the specified collection, but not both.
- TryGetValue(T, out T)
Searches the set for a given value and returns the equal value it finds, if any.
- Union(IEnumerable<T>)
Creates a new ImmutableValueSet<T> that is the union of this set and the specified collection.
Operators
- operator ==(ImmutableValueSet<T>?, ImmutableValueSet<T>?)
Determines whether two ImmutableValueSet<T> instances are equal by value.
- operator !=(ImmutableValueSet<T>?, ImmutableValueSet<T>?)
Determines whether two ImmutableValueSet<T> instances are not equal by value.