| | Collection Classes - slide 25 : 36 |
The interface IDictionary<K,V>
The interface IDictionary<K,V> is a subinterface of ICollection<KeyValuePair<K,V>>
- Operations in the interface IDictionary<K,V>
- The operations prescribed in ICollection<KeyValuePair<K,V>>
- The operations prescribed in IEnumerable<KeyValuePair<K,V>>
- V this[K key] - both getter and setter; the setter adds or mutates
- void Add(K key, V value) - only possible if key is not already present
- bool Remove(K key)
- bool ContainsKey(K key)
- bool TryGetValue(K key, out V value)
- ICollection<K>Keys - getter
- ICollection<V>Values - getter