// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Interface: ISet ** ** kimhamil ** ** ** Purpose: Base interface for all generic sets. ** ** ===========================================================*/ namespace System.Collections.Generic { using System; using System.Runtime.CompilerServices; /// /// Generic collection that guarantees the uniqueness of its elements, as defined /// by some comparer. It also supports basic set operations such as Union, Intersection, /// Complement and Exclusive Complement. /// public interface ISet : ICollection { //Add ITEM to the set, return true if added, false if duplicate new bool Add(T item); //Transform this set into its union with the IEnumerable other void UnionWith(IEnumerable other); //Transform this set into its intersection with the IEnumberable other void IntersectWith(IEnumerable other); //Transform this set so it contains no elements that are also in other void ExceptWith(IEnumerable other); //Transform this set so it contains elements initially in this or in other, but not both void SymmetricExceptWith(IEnumerable other); //Check if this set is a subset of other bool IsSubsetOf(IEnumerable other); //Check if this set is a superset of other bool IsSupersetOf(IEnumerable other); //Check if this set is a subset of other, but not the same as it bool IsProperSupersetOf(IEnumerable other); //Check if this set is a superset of other, but not the same as it bool IsProperSubsetOf(IEnumerable other); //Check if this set has any elements in common with other bool Overlaps(IEnumerable other); //Check if this set contains the same and only the same elements as other bool SetEquals(IEnumerable other); } }