|
Enhanced C#
Loyc library documentation
|
A dictionary with weak keys. More...
A dictionary with weak keys.
Original source: datavault project. License: Apache License 2.0
| TKey | : | class |
Properties | |
| override int | Count [get] |
| Number of items in the collection. More... | |
Properties inherited from Loyc.Collections.Impl.DictionaryBase< TKey, TValue > | |
| abstract int | Count [get] |
| ICollection< TKey > | Keys [get] |
| ICollection< TValue > | Values [get] |
| TValue | this[TKey key] [get, set] |
Properties inherited from Loyc.Collections.IIndexed< in K, out V > | |
| V | this[K key] [get] |
| Gets the value associated with the specified key. More... | |
Public Member Functions | |
| WeakKeyDictionary (int capacity) | |
| WeakKeyDictionary (IEqualityComparer< TKey > comparer) | |
| WeakKeyDictionary (int capacity, IEqualityComparer< TKey > comparer) | |
| override void | Add (TKey key, TValue value) |
| override bool | ContainsKey (TKey key) |
| override bool | Remove (TKey key) |
| override bool | TryGetValue (TKey key, [MaybeNullWhen(false)] out TValue value) |
| override void | Clear () |
|
override IEnumerator < KeyValuePair< TKey, TValue > > | GetEnumerator () |
| void | RemoveCollectedEntries () |
Public Member Functions inherited from Loyc.Collections.Impl.DictionaryBase< TKey, TValue > | |
| TValue | TryGet (TKey key, [MaybeNullWhen(false)] out bool fail) |
| void | Add (KeyValuePair< TKey, TValue > item) |
| bool | Contains (KeyValuePair< TKey, TValue > item) |
| void | CopyTo (KeyValuePair< TKey, TValue >[] array, int arrayIndex) |
| bool | Remove (KeyValuePair< TKey, TValue > item) |
Protected Member Functions | |
| override void | SetValue (TKey key, TValue value) |
| Implementation of the setter for this[]. More... | |
Additional Inherited Members | |
Public fields inherited from Loyc.Collections.Impl.DictionaryBase< TKey, TValue > | |
| bool | IsReadOnly => false |
| bool | IsEmpty => Count != 0 |
|
inlineprotectedvirtual |
Implementation of the setter for this[].
The setter alone (without the getter) is not allowed to be virtual in C# so a separate method is required.
Implements Loyc.Collections.Impl.DictionaryBase< TKey, TValue >.
|
get |
Number of items in the collection.
WARNING: The count returned here may include entries for which key value objects have already been garbage collected. Call RemoveCollectedEntries to weed out collected entries and update the count accordingly.
1.8.7