System.Collections and System.Collections.Specialized

By Fons Sonnemans, posted on
2198 Views

This table gives you an overview of all collections in the System.Collections and System.Collections.Specialized namespaces.

Class Key Value Remarks
System.Array   ? Predefined size, used for passing data around.
ArrayList   Object Easy to work with, provides basic collection functionality and can easily be converted to an Array.
BitArray   Boolean
Manages a compact array of bit values, which are represented as Booleans
CollectionBase   ? Abstract base for building your own collection classes.
DictionaryBase Object ? Abstract base for building your own collection classes using a key-value pair.
HashTable Object Object Provides high performance access to items in the key-value pair collection, by a specific key.
Queue   Object Implements the FIFO mechanism.
ReadOnlyCollectionBase   Object Abstract base for building your own read-only collection classes.
SortedList Object (sorted) Object Provides access to items in the collection by a specific key or an index (GetByIndex(int)).
Stack   Object Implements the LIFO mechanism.
Specialized.HybridDictionary
Object Object Uses internally a ListDictionary class when the collection is small, and switches automatically to a Hashtable class when the collection gets large.
Specialized.ListDictionary Object Object Is designed to be used for collections with 10 or less items, while the Hashtable is designed to contain more items.
Specialized.NameObjectCollectionBase String ? Abstract base for building your own collection classes using a key-value pair.
Specialized.NameValueCollection String (sorted) String NameValueCollection class is the strong type equivalent of the SortedList class, for the String class.
Specialized.StringCollection   Object Strongly typed ArrayList for the String class.
Specialized.StringDictionary String String Strongly typed Hashtable for the String class, not sorted.

Read also Jan Tielens article on the MSDN Belux website.

All postings/content on this blog are provided "AS IS" with no warranties, and confer no rights. All entries in this blog are my opinion and don't necessarily reflect the opinion of my employer or sponsors. The content on this site is licensed under a Creative Commons Attribution By license.

Leave a comment

Blog comments

0 responses