System.Collections.Generic Namespace
| Class | Description | |
|---|---|---|
|
Comparer | Provides a base class for implementations of the IComparer generic interface. |
|
Dictionary | Represents a collection of keys and values. |
|
Dictionary.KeyCollection | Represents the collection of keys in a Dictionary. This class cannot be inherited. |
|
Dictionary.ValueCollection | Represents the collection of values in a Dictionary. This class cannot be inherited. |
|
EqualityComparer | Provides a base class for implementations of the IEqualityComparer generic interface. |
|
KeyedByTypeCollection | Provides a collection whose items are types that serve as keys. |
|
KeyNotFoundException | The exception that is thrown when the key specified for accessing an element in a collection does not match any key in the collection. |
|
LinkedList | Represents a doubly linked list. |
|
LinkedListNode | Represents a node in a LinkedList. This class cannot be inherited. |
|
List | Represents a strongly typed list of objects that can be accessed by index. Provides methods to search, sort, and manipulate lists. |
|
Queue | Represents a first-in, first-out collection of objects. |
|
SortedDictionary | Represents a collection of key/value pairs that are sorted on the key. |
|
SortedDictionary.KeyCollection | Represents the collection of keys in a SortedDictionary. This class cannot be inherited. |
|
SortedDictionary.ValueCollection | Represents the collection of values in a SortedDictionary. This class cannot be inherited |
|
SortedList | Represents a collection of key/value pairs that are sorted by key based on the associated IComparer implementation. |
|
Stack | Represents a variable size last-in-first-out (LIFO) collection of instances of the same arbitrary type. |
|
SynchronizedCollection | Provides a thread-safe collection that contains objects of a type specified by the generic parameter as elements. |
|
SynchronizedKeyedCollection | Provides a thread-safe collection that contains objects of a type specified by a generic parameter and that are grouped by keys. |
|
SynchronizedReadOnlyCollection |
| Interface | Description | |
|---|---|---|
|
ICollection | Defines methods to manipulate generic collections. |
|
IComparer | Defines a method that a type implements to compare two objects. |
|
IDictionary | Represents a generic collection of key/value pairs. |
|
IEnumerable | Exposes the enumerator, which supports a simple iteration over a collection of a specified type. |
|
IEnumerator | Supports a simple iteration over a generic collection. |
|
IEqualityComparer | Defines methods to support the comparison of objects for equality. |
|
IList | Represents a collection of objects that can be individually accessed by index. |
| Structure | Description | |
|---|---|---|
|
Dictionary.Enumerator | Enumerates the elements of a Dictionary. |
|
Dictionary.KeyCollection.Enumerator | Enumerates the elements of a Dictionary.KeyCollection. |
|
Dictionary.ValueCollection.Enumerator | Enumerates the elements of a Dictionary.ValueCollection. |
|
KeyValuePair | Defines a key/value pair that can be set or retrieved. |
|
LinkedList.Enumerator | Enumerates the elements of a LinkedList. |
|
List.Enumerator | Enumerates the elements of a List. |
|
Queue.Enumerator | Enumerates the elements of a Queue. |
|
SortedDictionary.Enumerator | Enumerates the elements of a SortedDictionary. |
|
SortedDictionary.KeyCollection.Enumerator | Enumerates the elements of a SortedDictionary.KeyCollection. |
|
SortedDictionary.ValueCollection.Enumerator | Enumerates the elements of a SortedDictionary.ValueCollection. |
|
Stack.Enumerator | Enumerates the elements of a Stack. |
I wrote an article on this topic some time ago and I still think it's pretty good. You can find the full article here; I've included the introduction and resources below for your convenience.
Six Questions about Generics and Performance
Here are some comments from a recent discussion on Generics that I thought were generally useful. The comments have been edited so that they fit better with the general format of a Q&A session. The origin of this discussion was some commentary on the cost associated with creating instances of generic types where the type parameter is a value-type -- that case is interesting because the code for those classes cannot be shared like it can for reference types, so there can be considerable cost associated with their use.
As always many of these questions would require whole tomes to answer fully, so I'm giving an answer that's brief but only approximately correct. For additional information on Generics please see these links:
http://blogs.msdn.com/kcwalina/archive/2004/03/15/89860.aspx
http://www.15seconds.com/issue/031024.htm
http://research.microsoft.com/projects/clrgen/generics.pdf