Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

ISet Interface

A collection that contains no duplicate elements.

For a list of all members of this type, see ISet Members .

[Visual Basic]
Public Interface ISet
    Implements ICollection, IEnumerable, ICloneable
public interface ISet : ICollection, IEnumerable, ICloneable

Types that implement ISet

Type Description
DictionarySet DictionarySet is an abstract (MustInherit in Visual Basic) class that supports the creation of new ISet types where the underlying data store is an IDictionary instance.
HashedSet Implements an ISet based on a hash table.
HybridSet Implements an ISet that automatically changes from a list based implementation to a hashtable based implementation when the size reaches a certain threshold.
ImmutableSet Implements an immutable (read-only) ISet wrapper.
ListSet Implements a ISet based on a list.
Set A collection that contains no duplicate elements.
SortedSet Implements an ISet based on a sorted tree.
SynchronizedSet Implements a thread-safe ISet wrapper.
ManagedSet Tag subclass used to hold a set of managed elements.


This interface models the mathematical ISet abstraction. The order of elements in a set is dependant on (a)the data-structure implementation, and (b)the implementation of the various ISet methods, and thus is not guaranteed.

ISet overrides the Equals method to test for "equivalency": whether the two sets contain the same elements. The "==" and "!=" operators are not overridden by design, since it is often desirable to compare object references for equality.

Also, the GetHashCode method is not implemented on any of the set implementations, since none of them are truly immutable. This is by design, and it is the way almost all collections in the .NET framework function. So as a general rule, don't store collection objects inside ISet instances. You would typically want to use a keyed IDictionary instead.

None of the ISet implementations in this library are guaranteed to be thread-safe in any way unless wrapped in a SynchronizedSet.

The following table summarizes the binary operators that are supported by the ISet class.

Operation Description Method
Union (OR) Element included in result if it exists in either A OR B. Union()
Intersection (AND) Element included in result if it exists in both A AND B. InterSect()
Exclusive Or (XOR) Element included in result if it exists in one, but not both, of A and B. ExclusiveOr()
Minus (n/a) Take all the elements in A. Now, if any of them exist in B, remove them. Note that unlike the other operators, A - B is not the same as B - A. Minus()


Namespace: Spring.Collections

Assembly: Spring.Core (in Spring.Core.dll)

See Also

ISet Members | Spring.Collections Namespace