ISet<T> ISet<T> ISet<T> ISet<T> Interface

Definition

Provides the base interface for the abstraction of sets.

generic <typename T>
public interface class ISet : System::Collections::Generic::ICollection<T>, System::Collections::Generic::IEnumerable<T>
public interface ISet<T> : System.Collections.Generic.ICollection<T>, System.Collections.Generic.IEnumerable<T>
type ISet<'T> = interface
    interface ICollection<'T>
    interface seq<'T>
    interface IEnumerable
Public Interface ISet(Of T)
Implements ICollection(Of T), IEnumerable(Of T)

Type Parameters

T

The type of elements in the set.

Derived
Implements

Remarks

This interface provides methods for implementing sets, which are collections that have unique elements and specific operations. The HashSet<T> and SortedSet<T> collections implement this interface.

Methods

Add(T) Add(T) Add(T) Add(T)

Adds an element to the current set and returns a value to indicate if the element was successfully added.

Clear() Clear() Clear() Clear()

Removes all items from the ICollection<T>.

(Inherited from ICollection<T>)
Contains(T) Contains(T) Contains(T) Contains(T)

Determines whether the ICollection<T> contains a specific value.

(Inherited from ICollection<T>)
CopyTo(T[], Int32) CopyTo(T[], Int32) CopyTo(T[], Int32) CopyTo(T[], Int32)

Copies the elements of the ICollection<T> to an Array, starting at a particular Array index.

(Inherited from ICollection<T>)
ExceptWith(IEnumerable<T>) ExceptWith(IEnumerable<T>) ExceptWith(IEnumerable<T>) ExceptWith(IEnumerable<T>)

Removes all elements in the specified collection from the current set.

GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

Returns an enumerator that iterates through a collection.

(Inherited from IEnumerable)
IntersectWith(IEnumerable<T>) IntersectWith(IEnumerable<T>) IntersectWith(IEnumerable<T>) IntersectWith(IEnumerable<T>)

Modifies the current set so that it contains only elements that are also in a specified collection.

IsProperSubsetOf(IEnumerable<T>) IsProperSubsetOf(IEnumerable<T>) IsProperSubsetOf(IEnumerable<T>) IsProperSubsetOf(IEnumerable<T>)

Determines whether the current set is a proper (strict) subset of a specified collection.

IsProperSupersetOf(IEnumerable<T>) IsProperSupersetOf(IEnumerable<T>) IsProperSupersetOf(IEnumerable<T>) IsProperSupersetOf(IEnumerable<T>)

Determines whether the current set is a proper (strict) superset of a specified collection.

IsSubsetOf(IEnumerable<T>) IsSubsetOf(IEnumerable<T>) IsSubsetOf(IEnumerable<T>) IsSubsetOf(IEnumerable<T>)

Determines whether a set is a subset of a specified collection.

IsSupersetOf(IEnumerable<T>) IsSupersetOf(IEnumerable<T>) IsSupersetOf(IEnumerable<T>) IsSupersetOf(IEnumerable<T>)

Determines whether the current set is a superset of a specified collection.

Overlaps(IEnumerable<T>) Overlaps(IEnumerable<T>) Overlaps(IEnumerable<T>) Overlaps(IEnumerable<T>)

Determines whether the current set overlaps with the specified collection.

Remove(T) Remove(T) Remove(T) Remove(T)

Removes the first occurrence of a specific object from the ICollection<T>.

(Inherited from ICollection<T>)
SetEquals(IEnumerable<T>) SetEquals(IEnumerable<T>) SetEquals(IEnumerable<T>) SetEquals(IEnumerable<T>)

Determines whether the current set and the specified collection contain the same elements.

SymmetricExceptWith(IEnumerable<T>) SymmetricExceptWith(IEnumerable<T>) SymmetricExceptWith(IEnumerable<T>) SymmetricExceptWith(IEnumerable<T>)

Modifies the current set so that it contains only elements that are present either in the current set or in the specified collection, but not both.

UnionWith(IEnumerable<T>) UnionWith(IEnumerable<T>) UnionWith(IEnumerable<T>) UnionWith(IEnumerable<T>)

Modifies the current set so that it contains all elements that are present in the current set, in the specified collection, or in both.

Properties

Count Count Count Count

Gets the number of elements contained in the ICollection<T>.

(Inherited from ICollection<T>)
IsReadOnly IsReadOnly IsReadOnly IsReadOnly

Gets a value indicating whether the ICollection<T> is read-only.

(Inherited from ICollection<T>)

Extension Methods

CopyToDataTable<T>(IEnumerable<T>) CopyToDataTable<T>(IEnumerable<T>) CopyToDataTable<T>(IEnumerable<T>) CopyToDataTable<T>(IEnumerable<T>)

Returns a DataTable that contains copies of the DataRow objects, given an input IEnumerable<T> object where the generic parameter T is DataRow.

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption)

Copies DataRow objects to the specified DataTable, given an input IEnumerable<T> object where the generic parameter T is DataRow.

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler)

Copies DataRow objects to the specified DataTable, given an input IEnumerable<T> object where the generic parameter T is DataRow.

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

Converts an IEnumerable to an IQueryable.

Ancestors<T>(IEnumerable<T>) Ancestors<T>(IEnumerable<T>) Ancestors<T>(IEnumerable<T>) Ancestors<T>(IEnumerable<T>)

Returns a collection of elements that contains the ancestors of every node in the source collection.

Ancestors<T>(IEnumerable<T>, XName) Ancestors<T>(IEnumerable<T>, XName) Ancestors<T>(IEnumerable<T>, XName) Ancestors<T>(IEnumerable<T>, XName)

Returns a filtered collection of elements that contains the ancestors of every node in the source collection. Only elements that have a matching XName are included in the collection.

DescendantNodes<T>(IEnumerable<T>) DescendantNodes<T>(IEnumerable<T>) DescendantNodes<T>(IEnumerable<T>) DescendantNodes<T>(IEnumerable<T>)

Returns a collection of the descendant nodes of every document and element in the source collection.

Descendants<T>(IEnumerable<T>) Descendants<T>(IEnumerable<T>) Descendants<T>(IEnumerable<T>) Descendants<T>(IEnumerable<T>)

Returns a collection of elements that contains the descendant elements of every element and document in the source collection.

Descendants<T>(IEnumerable<T>, XName) Descendants<T>(IEnumerable<T>, XName) Descendants<T>(IEnumerable<T>, XName) Descendants<T>(IEnumerable<T>, XName)

Returns a filtered collection of elements that contains the descendant elements of every element and document in the source collection. Only elements that have a matching XName are included in the collection.

Elements<T>(IEnumerable<T>) Elements<T>(IEnumerable<T>) Elements<T>(IEnumerable<T>) Elements<T>(IEnumerable<T>)

Returns a collection of the child elements of every element and document in the source collection.

Elements<T>(IEnumerable<T>, XName) Elements<T>(IEnumerable<T>, XName) Elements<T>(IEnumerable<T>, XName) Elements<T>(IEnumerable<T>, XName)

Returns a filtered collection of the child elements of every element and document in the source collection. Only elements that have a matching XName are included in the collection.

InDocumentOrder<T>(IEnumerable<T>) InDocumentOrder<T>(IEnumerable<T>) InDocumentOrder<T>(IEnumerable<T>) InDocumentOrder<T>(IEnumerable<T>)

Returns a collection of nodes that contains all nodes in the source collection, sorted in document order.

Nodes<T>(IEnumerable<T>) Nodes<T>(IEnumerable<T>) Nodes<T>(IEnumerable<T>) Nodes<T>(IEnumerable<T>)

Returns a collection of the child nodes of every document and element in the source collection.

Remove<T>(IEnumerable<T>) Remove<T>(IEnumerable<T>) Remove<T>(IEnumerable<T>) Remove<T>(IEnumerable<T>)

Removes every node in the source collection from its parent node.

Applies to