Enhanced C#
Language of your choice: library documentation
|
An adapter that converts a collection of keys to an IReadOnlyDictionary. Used by EnumerableExt.AsReadOnlyDictionarybased on a function that can obtain a value for a given key. More...
An adapter that converts a collection of keys to an IReadOnlyDictionary. Used by EnumerableExt.AsReadOnlyDictionarybased on a function that can obtain a value for a given key.
K | Key type |
V | Value type |
Public fields | |
IEnumerable< K > | Keys => _keys |
IEnumerable< V > | Values |
int | Count => _keys.Count |
Properties | |
V | this[K key] [get] |
Public Member Functions | |
SelectDictionaryFromKeys (IReadOnlyCollection< K > keys, Func< K, Maybe< V >> tryGetValue, Func< K, V > getValue=null) | |
Initializes the adapter. More... | |
bool | ContainsKey (K key) |
IEnumerator< KeyValuePair< K, V > > | GetEnumerator () |
bool | TryGetValue (K key, out V value) |
|
inline |
Initializes the adapter.
keys | A collection of dictionary keys. |
tryGetValue | This function is used both to test membership and to get values. |
getValue | This function is optional. It is used to get values when it is known in advance that the key exists (in GetEnumerator() and in the Values property). If this is null, tryGetValue is used instead. Providing this function can increase performance. |
IEnumerable<V> Loyc.Collections.SelectDictionaryFromKeys< K, V >.Values |