Foley.Utilities.Collections
Class SetBase

Provides an abstract implementation of the Foley.Utilities.Collections.ISet interface and extends Foley.Utilities.Collections.Collection2Base.

The main purpose of this is an all purpose base class that can be extended by any class that wants to be a set.

Constructor Summary
SetBase()
         Protected constructor for abstract class.

Properties inherited from class Foley.Utilities.Collections.Collection2Base
Count, IsEmpty, IsFixedSize, IsReadOnly, IsSynchronized, SyncRoot

Method Summary
bool Add(System.Collections.ICollection collection)
         Adds the elements of the specified System.Collections.ICollection to the set.
bool Add(object value)
         When implemented by a class, adds an System.Object to the set.
bool Contains(System.Collections.ICollection collection)
         Determines whether all the elements in the specified System.Collections.ICollection are contained in the set.
bool Contains(object value)
         Determines whether the specified System.Object is in the set.
bool Remove(System.Collections.ICollection collection)
         Removes the first occurrence of each element of the specified System.Collections.ICollection from the set.
bool Remove(object value)
         When implemented by a class, removes the first occurrence of a specific System.Object from the set.
bool Retain(System.Collections.ICollection collection)
         Retains the first occurrence of each element of the specified System.Collections.ICollection from the set.

Methods inherited from class Foley.Utilities.Collections.Collection2Base
Clear, CopyTo, GetEnumerator, IsContainedIn

Methods inherited from class System.Object
Equals, Finalize, GetHashCode, GetType, MemberwiseClone, ToString


Constructor Detail

SetBase

protected SetBase()

Protected constructor for abstract class.

Method Detail

Add

public bool Add(System.Collections.ICollection collection)

Adds the elements of the specified System.Collections.ICollection to the set.

Parameters:
collection - The System.Collections.ICollection whose elements are added to the set.
Returns:
true if the set is modified; otherwise false.
Throws:
System.NullReferenceException - The collection is a null reference (Nothing in Visual Basic).

Add

public bool Add(object value)

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

Parameters:
value - true if the set is modified; otherwise false.
Returns:
The zero-based index at which the System.Object was added.

Contains

public bool Contains(System.Collections.ICollection collection)

Determines whether all the elements in the specified System.Collections.ICollection are contained in the set.

This method determines equality by calling System.Object.Equals(System.Object). Keep in mind that the System.Object to locate can be a null reference (Nothing in Visual Basic). If you do not want this behaviour you must override this method.

Parameters:
collection - The System.Collections.ICollection whose elements are to be checked if all of its elements are contained in the set.
Returns:
true if all the elements of the System.Collections.ICollection are found in the set; otherwise, false.
Throws:
System.NullReferenceException - The collection is a null reference (Nothing in Visual Basic).

Contains

public bool Contains(object value)

Determines whether the specified System.Object is in the set.

This method determines equality by calling System.Object.Equals(System.Object). Keep in mind that the System.Object to locate can be a null reference (Nothing in Visual Basic). If you do not want this behaviour you must override this method.

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

Remove

public bool Remove(System.Collections.ICollection collection)

Removes the first occurrence of 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 first occurrence of a 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.

Retain

public bool Retain(System.Collections.ICollection collection)

Retains the first occurrence of each element of the specified System.Collections.ICollection from 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.