Interface ISet<T>
Generic collection that guarantees the uniqueness of its elements, as defined by a comparer. It also supports basic set operations such as Union, Intersection, Difference, and Symmetric Difference.
Inherited Members
Namespace: Unity.VisualScripting
Assembly: Unity.VisualScripting.Core.dll
Syntax
public interface ISet<T> : ICollection<T>, IEnumerable<T>, IEnumerable
Type Parameters
Name | Description |
---|---|
T | The type of elements contained in the set. |
Methods
Add(T)
Adds the specified item to the set.
Declaration
bool Add(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item | The item to add to the set. |
Returns
Type | Description |
---|---|
bool |
|
ExceptWith(IEnumerable<T>)
Modifies the current set to contain only elements that are not present in the specified collection.
Declaration
void ExceptWith(IEnumerable<T> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | other | The collection to compare to the current set. |
IntersectWith(IEnumerable<T>)
Modifies the current set to contain only elements that are present in both the current set and the specified collection.
Declaration
void IntersectWith(IEnumerable<T> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | other | The collection to compare to the current set. |
IsProperSubsetOf(IEnumerable<T>)
Determines whether the current set is a proper subset of the specified collection. A proper subset is a subset that is not equal to the other set.
Declaration
bool IsProperSubsetOf(IEnumerable<T> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | other | The collection to compare to the current set. |
Returns
Type | Description |
---|---|
bool |
|
IsProperSupersetOf(IEnumerable<T>)
Determines whether the current set is a proper superset of the specified collection. A proper superset is a superset that is not equal to the other set.
Declaration
bool IsProperSupersetOf(IEnumerable<T> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | other | The collection to compare to the current set. |
Returns
Type | Description |
---|---|
bool |
|
IsSubsetOf(IEnumerable<T>)
Determines whether the current set is a subset of the specified collection.
Declaration
bool IsSubsetOf(IEnumerable<T> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | other | The collection to compare to the current set. |
Returns
Type | Description |
---|---|
bool |
|
IsSupersetOf(IEnumerable<T>)
Determines whether the current set is a superset of the specified collection.
Declaration
bool IsSupersetOf(IEnumerable<T> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | other | The collection to compare to the current set. |
Returns
Type | Description |
---|---|
bool |
|
Overlaps(IEnumerable<T>)
Determines whether the current set has any elements in common with the specified collection.
Declaration
bool Overlaps(IEnumerable<T> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | other | The collection to compare to the current set. |
Returns
Type | Description |
---|---|
bool |
|
SetEquals(IEnumerable<T>)
Determines whether the current set and the specified collection contain the same elements.
Declaration
bool SetEquals(IEnumerable<T> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | other | The collection to compare to the current set. |
Returns
Type | Description |
---|---|
bool |
|
SymmetricExceptWith(IEnumerable<T>)
Modifies the current set to contain only elements that are present either in the current set or in the specified collection, but not both.
Declaration
void SymmetricExceptWith(IEnumerable<T> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | other | The collection to compare to the current set. |
UnionWith(IEnumerable<T>)
Modifies the current set to contain all elements that are present in either the current set or the specified collection.
Declaration
void UnionWith(IEnumerable<T> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | other | The collection to compare to the current set. |