// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Interface: ISet ** ** kimhamil ** ** ** Purpose: Base interface for all generic sets. ** ** ===========================================================*/ using System.Collections.Generic; namespace Unity.VisualScripting { /// /// 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. /// /// The type of elements contained in the set. public interface ISet : ICollection { /// /// Adds the specified item to the set. /// /// The item to add to the set. /// /// true if the item was added to the set (i.e., it was not already present); /// otherwise, false. /// new bool Add(T item); /// /// Modifies the current set to contain all elements that are present in either the current set or the specified collection. /// /// The collection to compare to the current set. void UnionWith(IEnumerable other); /// /// Modifies the current set to contain only elements that are present in both the current set and the specified collection. /// /// The collection to compare to the current set. void IntersectWith(IEnumerable other); /// /// Modifies the current set to contain only elements that are not present in the specified collection. /// /// The collection to compare to the current set. void ExceptWith(IEnumerable other); /// /// Modifies the current set to contain only elements that are present either in the current set or in the specified collection, but not both. /// /// The collection to compare to the current set. void SymmetricExceptWith(IEnumerable other); /// /// Determines whether the current set is a subset of the specified collection. /// /// The collection to compare to the current set. /// /// true if the current set is a subset of the specified collection; otherwise, false. /// bool IsSubsetOf(IEnumerable other); /// /// Determines whether the current set is a superset of the specified collection. /// /// The collection to compare to the current set. /// /// true if the current set is a superset of the specified collection; otherwise, false. /// bool IsSupersetOf(IEnumerable other); /// /// 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. /// /// The collection to compare to the current set. /// /// true if the current set is a proper subset of the specified collection; otherwise, false. /// bool IsProperSubsetOf(IEnumerable other); /// /// 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. /// /// The collection to compare to the current set. /// /// true if the current set is a proper superset of the specified collection; otherwise, false. /// bool IsProperSupersetOf(IEnumerable other); /// /// Determines whether the current set has any elements in common with the specified collection. /// /// The collection to compare to the current set. /// /// true if the current set and the specified collection share at least one common element; otherwise, false. /// bool Overlaps(IEnumerable other); /// /// Determines whether the current set and the specified collection contain the same elements. /// /// The collection to compare to the current set. /// /// true if the current set and the specified collection contain the same elements; otherwise, false. /// bool SetEquals(IEnumerable other); } }