Foley.Utilities.Collections
Interface ISet

Represents a collection of objects that contains no duplicate elements.

Foley.Utilities.Collections.ISet is a descendant of the Foley.Utilities.Collections.ICollection2interface and is the base interface for all sets.

Example: If you have element1 and element12 then element1.Equals(element12) cannot be true inside the set, and if null is allowed then no more than one null element in a set.

It is therefore recommend that the user of the set understand how the objects contained in it are handled by their Equals method.

A set, unless otherwise stated, does not gaurentee it's elements to be contiguous.

Method Summary
bool Add(System.Collections.ICollection collection)
         When implemented by a class, adds all the elements in the specified collection that are not already contained in the set.
bool Add(object value)
         When implemented by a class, adds an System.Object to the set.
bool Contains(System.Collections.ICollection collection)
         When implemented by a class determines whether the set contains all of the elements of the specified System.Collections.ICollection.
bool Contains(object value)
         When implemented by a class, determines whether the set contains the specific System.Object.
bool Remove(System.Collections.ICollection collection)
         When implemented by a class, removes each element of the specified System.Collections.ICollection from the set.
bool Remove(object value)
         When implemented by a class, removes the specific System.Object from the set.
bool Retain(System.Collections.ICollection collection)
         When implemented by a class, retains each element of the specified System.Collections.ICollection in the set.


Method Detail

Add

public bool Add(System.Collections.ICollection collection)

When implemented by a class, adds all the elements in the specified collection that are not already contained in the set.

Parameters:
collection - The System.Collections.ICollection whose elements are to be added to the set.
Returns:
true if the set is modified; otherwise false.
Throws:
System.NotSupportedException -

The set is read-only.

-or-

The set has a fixed size.


Add

public bool Add(object value)

When implemented by a class, adds an System.Object to the set.

Parameters:
value - The System.Object to add to the set.
Returns:
true if the System.Object was successfully added; otherwise, false.
Throws:
System.NotSupportedException -

The set is read-only.

-or-

The set has a fixed size.


Contains

public bool Contains(System.Collections.ICollection collection)

When implemented by a class determines whether the set contains all of the elements of the specified System.Collections.ICollection.

Parameters:
collection - The System.Collections.ICollection used to determine if all its elements are contained within the set.
Returns:
true if all the elements are found in the set; otherwise, false.

Contains

public bool Contains(object value)

When implemented by a class, determines whether the set contains the specific System.Object.

Parameters:
value - The System.Object to locate in the set.
Returns:
true if the System.Object is found in the set; otherwise, false.

Remove

public bool Remove(System.Collections.ICollection collection)

When implemented by a class, removes each element of the specified System.Collections.ICollection from the set.

Parameters:
collection - The System.Collections.ICollection used to determine what elements to remove from the set.
Returns:
true if the set is modified; otherwise false.
Throws:
System.NotSupportedException -

The set is read-only.

-or-

The set has a fixed size.


Remove

public bool Remove(object value)

When implemented by a class, removes the specific System.Object from the set.

Parameters:
value - The System.Object to remove from the set.
Returns:
true if the set is modified; otherwise false.
Throws:
System.NotSupportedException -

The set is read-only.

-or-

The set has a fixed size.


Retain

public bool Retain(System.Collections.ICollection collection)

When implemented by a class, retains each element of the specified System.Collections.ICollection in the set.

Parameters:
collection - The System.Collections.ICollection used to determine what elements to be retained in the set.
Returns:
true if the set is modified; otherwise false.
Throws:
System.NotSupportedException -

The set is read-only.

-or-

The set has a fixed size.