DefaultDict<'K, 'V> Type
A Collections.Generic.Dictionary<'K,'V> with default Values that get created upon accessing a missing key.
If accessing a non exiting key , the default function is called to create and set it.
Inspired by the defaultdict in Python.
If you need to provide a custom implementation of the default function depending on each key,
then use the Dict<'K,'V> type and it's method
Constructors
Constructor | Description |
Full Usage:
DefaultDict(defaultOfKeyFun)
Parameters:
'K -> 'V
-
('K->'V): The function to create a default value from the key
Returns: DefaultDict<'K, 'V>
|
|
Instance members
Instance member | Description |
Full Usage:
this.Add
Parameters:
'K
v : 'V
|
|
Full Usage:
this.AsString
Returns: string
|
|
Full Usage:
this.Clear
|
|
Full Usage:
this.ContainsKey
Parameters:
'K
Returns: bool
|
|
Full Usage:
this.ContainsValue
Parameters:
'V
Returns: bool
|
|
Full Usage:
this.Count
Returns: int
|
|
Full Usage:
this.DoesNotContainKey
Parameters:
'K
Returns: bool
|
|
Full Usage:
this.Get
Parameters:
'K
Returns: 'V
|
|
|
|
Full Usage:
this[k]
Returns: 'K
|
|
Full Usage:
this.Items
Returns: ('K * 'V) seq
|
|
|
|
Full Usage:
this.Pop
Parameters:
'K
Returns: 'V
|
|
Full Usage:
this.Remove
Parameters:
'K
Returns: bool
|
|
Full Usage:
this.Set
Parameters:
'K
value : 'V
|
|
Full Usage:
this.ToString
Parameters:
int
Returns: string
|
|
Full Usage:
this.TryGetValue
Parameters:
'K
Returns: bool * 'V
|
|
|
|
Static members
Static member | Description |
Full Usage:
DefaultDict.create defaultOfKeyFun keysValues
Parameters:
'K -> 'V
keysValues : ('K * 'V) seq
Returns: DefaultDict<'K, 'V>
|
|
Full Usage:
DefaultDict.createDirectly defaultOfKeyFun di
Parameters:
'K -> 'V
di : Dictionary<'K, 'V>
Returns: DefaultDict<'K, 'V>
|
|
|
|
|
|