Lecture overview -- Keyboard shortcut: 'u'  Previous page: The interface <b><kbd>IDictionary<K,V></kbd></b> -- Keyboard shortcut: 'p'  Next page: Sample use of class <b><kbd>Dictionary<K,V></kbd></b> -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Help page about these notes  Alphabetic index  Course home  Page 26 : 36
Object-oriented Programming in C#
Collection Classes
Overview of the class Dictionary<K,V>

 

  • Members of class Dictionary<K,V>

    • Constructors

      • Dictionary(),   Dictionary(IDictionary<K,V>),   Dictionary(IEqualityComparer<K>),   Dictionary(int),   and more

    • Value addition

      • Add(K, V),
        this[K] = V         if K is not already in the dictionary

    • Value mutation

      • this[K] = V         if K is already in the dictionary

    • Element removal

      • Remove(K),   Clear()

    • Value access

      • this[K],   Values,   TryGetValue(K, out V)

    • Key access

      • Keys

    • Boolean queries

      • ContainsKey(K),   ContainsValue(V)

    • Others

      • Count

      • Comparer