My Development Notes

By Haemoglobin
3/10/2010 (revision 1)

Collections

ArrayList.Add, .Remove, .Insert(4, "test"), .Sort() (uses objects IComparable.CompareTo), .Sort(new ReverseSort()), .BinarySearch(o) (returns int index), .AddRange, .Synchronized(arrayList) to return syncrhonized version.
Queue.Enqueue, .Dequeue, .Clear
Stack.Push, .Pop, .Clear
BitVector32for storing 32 or fewers bools
Hashtable
SortedListAutomatically sorts by key
StringDictionary(string, string)
ListDictionaryoptimised for less than 10 items
HybridDictionaryuses ListDictionary when less than 10 then switches to Hashtable
NameValueCollectionCan have duplicate keys, .GetValues("keyName")

Generic Collections

List<T>
Dictionary<T,U>
Queue<T>
Stack<T>
SortedList<T,U>
Collection<T>
ReadOnlyCollection<T>
public class ReverseSort : IComparer {
    int IComparer.Compare(object x, object y) {
        return ((new CaseInsensitiveComparer()).Compare(y,x); 
    }
}

Comments

Powered by BlogEngine.NET 1.6.1.0 | Design by styleshout | Enhanced by GravityCube.net | 1.4.5 Changes by zembian.com | Adapted by HamishGraham.NET
(c) 2010 Hamish Graham. Banner Image (c) Chris Gin