|
.NET Framework | |||||||||
PREV TYPE NEXT TYPE | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONST | PROP | METHOD | OP | EVENT | DETAIL: FIELD | CONST | PROP | METHOD | OP | EVENT |
A Doubly-Linked Set implementation extending the abstract Foley.Utilities.Collections.SetBase class.
Field Summary | |
---|---|
Foley.Utilities.Collections.LinkedList | list |
Constructor Summary | |
---|---|
LinkedSet() Initializes a new instance of the Foley.Utilities.Collections.LinkedSet class that is empty. |
|
LinkedSet(System.Collections.ICollection collection) Initializes a new instance of the Foley.Utilities.Collections.LinkedSet class that contains elements copied from the specified collection. |
Property Summary | |
---|---|
int |
Count
Gets the number of elements contained in the Foley.Utilities.Collections.LinkedSet. |
bool |
IsEmpty
Gets a boolean value indicating whether the Foley.Utilities.Collections.LinkedSet is empty or not. |
object |
SyncRoot
Gets an System.Object that can be used to synchronize access to the Foley.Utilities.Collections.LinkedSet. |
Properties inherited from class Foley.Utilities.Collections.Collection2Base |
---|
IsFixedSize, IsReadOnly, IsSynchronized |
Method Summary | |
---|---|
bool |
Add(System.Collections.ICollection collection) Adds the elements of an System.Collections.ICollection to the end of the Foley.Utilities.Collections.LinkedSet. |
bool |
Add(object value) Adds an System.Object to the end of the Foley.Utilities.Collections.LinkedSet. |
void |
Clear() Removes all elements from the Foley.Utilities.Collections.LinkedSet. |
object |
Clone() Creates a shallow copy of the Foley.Utilities.Collections.LinkedSet. |
Foley.Utilities.Collections.LinkedSet |
Clone(bool attemptDeepCopy) Attempts to make a deep copy of the Foley.Utilities.Collections.LinkedSet. |
bool |
Contains(System.Collections.ICollection collection) Determines whether all the elements in the specified collection are contained in the Foley.Utilities.Collections.LinkedSet. |
bool |
Contains(object value) Determines whether an System.Object is in the Foley.Utilities.Collections.LinkedSet. |
void |
CopyTo(System.Array array, int index) Copies the entire Foley.Utilities.Collections.LinkedSet to a compatible one-dimensional System.Array, starting at the specified index of the target array. |
System.Collections.IEnumerator |
GetEnumerator() Returns an enumerator for the entire Foley.Utilities.Collections.LinkedSet. |
bool |
Remove(System.Collections.ICollection collection) Removes the occurrence of each element of the specified System.Collections.ICollection from the Foley.Utilities.Collections.LinkedSet. |
bool |
Remove(object value) Removes the occurrence of the specific System.Object from the Foley.Utilities.Collections.LinkedSet. |
bool |
Retain(System.Collections.ICollection collection) Retains the occurrence of each element of the specified System.Collections.ICollection from the Foley.Utilities.Collections.LinkedSet. |
Methods inherited from class Foley.Utilities.Collections.Collection2Base |
---|
IsContainedIn |
Methods inherited from class System.Object |
---|
Equals, Finalize, GetHashCode, GetType, MemberwiseClone, ToString |
Field Detail |
---|
private Foley.Utilities.Collections.LinkedList list
Constructor Detail |
---|
public LinkedSet()
Initializes a new instance of the Foley.Utilities.Collections.LinkedSet class that is empty.
public LinkedSet(System.Collections.ICollection collection)
Initializes a new instance of the Foley.Utilities.Collections.LinkedSet class that contains elements copied from the specified collection.
Parameters:
collection
-
The System.Collections.ICollection whose elements are copied to the new list.
Property Detail |
---|
public int Count
Gets the number of elements contained in the Foley.Utilities.Collections.LinkedSet.
Value:
public bool IsEmpty
Gets a boolean value indicating whether the Foley.Utilities.Collections.LinkedSet is empty or not.
Value:
public object SyncRoot
Gets an System.Object that can be used to synchronize access to the Foley.Utilities.Collections.LinkedSet.
Value:
Method Detail |
---|
public bool Add(System.Collections.ICollection collection)
Adds the elements of an System.Collections.ICollection to the end of the Foley.Utilities.Collections.LinkedSet.
Parameters:
collection
-
The System.Collections.ICollection whose elements
should be added to the end of the Foley.Utilities.Collections.LinkedSet.
System.ArgumentNullException
-
The collection is a null reference
(Nothing in Visual Basic).
public bool Add(object value)
Adds an System.Object to the end of the Foley.Utilities.Collections.LinkedSet.
Parameters:
value
-
The System.Object to be added to the end of
the Foley.Utilities.Collections.LinkedSetpublic void Clear()
Removes all elements from the Foley.Utilities.Collections.LinkedSet.
public object Clone()
Creates a shallow copy of the Foley.Utilities.Collections.LinkedSet.
If you need a deep copy to be attempted use the Foley.Utilities.Collections.LinkedSet.Clone(System.Boolean) method.
Returns:public Foley.Utilities.Collections.LinkedSet Clone(bool attemptDeepCopy)
Attempts to make a deep copy of the Foley.Utilities.Collections.LinkedSet.
Attempts to make a deep copy if attemptDeepCopy is true. It will attempt this by checking if an System.Object is an System.ICloneable, and then defer the process to its Clone method. At the first System.Object that is not an System.ICloneable a SystemException will be thrown.
If a true deep copy is important, please check the API documentation for the elements that are contained in the list to verify how their Clone method is implemented.
Parameters:attemptDeepCopy
-
If true will attempt to make a deep copy,
if false it will just return a shallow copy
System.SystemException
-
If and System.Object in the list is not an
System.ICloneable.
System.SystemException
-
At the first System.Object that is not an System.ICloneable
when attemptDeepCopy is true.
public bool Contains(System.Collections.ICollection collection)
Determines whether all the elements in the specified collection are contained in the Foley.Utilities.Collections.LinkedSet.
Parameters:
collection
-
The System.Collections.ICollection whose elements are to be added
to the end of the Foley.Utilities.Collections.LinkedSet.
System.ArgumentNullException
-
The collection is a null reference
(Nothing in Visual Basic).
public bool Contains(object value)
Determines whether an System.Object is in the Foley.Utilities.Collections.LinkedSet.
This method determines equality by calling System.Object.Equals(System.Object).
Parameters:value
-
The System.Object to locate in the Foley.Utilities.Collections.LinkedSet.
The System.Object to locate can be a null reference (Nothing in Visual Basic).
public void CopyTo(System.Array array, int index)
Copies the entire Foley.Utilities.Collections.LinkedSet to a compatible one-dimensional System.Array, starting at the specified index of the target array.
Parameters:
array
-
The one-dimensional System.Array that is the destination of the elements
copied from the Foley.Utilities.Collections.LinkedSet. The System.Array must have zero-based indexing.
index
-
The zero-based index in array at which copying begins.
System.ArgumentNullException
-
The array is a null reference (Nothing in Visual Basic).
System.ArgumentOutOfRangeException
-
The index is less than zero.
System.ArgumentException
-
The array is multidimensional.
-or-
The index is equal to or greater than the length of array.
-or-
The number of elements in the Foley.Utilities.Collections.LinkedSet is greater than
the available space from index to the end of the destination array.
public System.Collections.IEnumerator GetEnumerator()
Returns an enumerator for the entire Foley.Utilities.Collections.LinkedSet.
Returns:
public bool Remove(System.Collections.ICollection collection)
Removes the occurrence of each element of the specified System.Collections.ICollection from the Foley.Utilities.Collections.LinkedSet.
Parameters:
collection
-
The System.Collections.ICollection used to determine what
elements to remove from the Foley.Utilities.Collections.LinkedSet.
System.NotSupportedException
- The Foley.Utilities.Collections.LinkedSet is read-only.
-or-The Foley.Utilities.Collections.LinkedSet has a fixed size.
System.ArgumentNullException
-
The collection is a null reference
(Nothing in Visual Basic).
public bool Remove(object value)
Removes the occurrence of the specific System.Object from the Foley.Utilities.Collections.LinkedSet.
Parameters:
value
-
The System.Object to remove from the Foley.Utilities.Collections.LinkedSet.
public bool Retain(System.Collections.ICollection collection)
Retains the occurrence of each element of the specified System.Collections.ICollection from the Foley.Utilities.Collections.LinkedSet.
Parameters:
collection
-
The System.Collections.ICollection used to determine what
elements to be retained in the Foley.Utilities.Collections.LinkedSet.
System.NotSupportedException
- The Foley.Utilities.Collections.LinkedSet is read-only.
-or-The Foley.Utilities.Collections.LinkedSet has a fixed size.
System.ArgumentNullException
-
The collection is a null reference
(Nothing in Visual Basic).
|
.NET Framework | |||||||||
PREV TYPE NEXT TYPE | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONST | PROP | METHOD | OP | EVENT | DETAIL: FIELD | CONST | PROP | METHOD | OP | EVENT |