Joutsen v0.5.0+12-g5dd5f7e
Public Member Functions | Properties | List of all members
Joutsen.Collections.Generic.Map< KeyType, ValueType > Interface Template Reference

An interface for classes mapping keys to values. More...

Public Member Functions

void Update (SCG.IEnumerable< SCG.KeyValuePair< KeyType, ValueType > > newValues)
 Adds or updates values in the map. More...
 
new bool ContainsKey (KeyType key)
 Checks if a key is part of the map. More...
 
- Public Member Functions inherited from Joutsen.Collections.Generic.Collection< SCG.KeyValuePair< KeyType, ValueType > >
bool Contains (ItemType item, SCG.IEqualityComparer< ItemType > comparer)
 Checks if an item is part of the collection. More...
 
void Add (SCG.IEnumerable< ItemType > items)
 Adds multiple items to the collection. More...
 
- Public Member Functions inherited from Joutsen.Collections.Generic.Mapping< KeyType, ValueType >
bool ContainsKey (KeyType key)
 Checks if a key is part of the mapping. More...
 
ValueType GetValue (KeyType key, ValueType defaultValue)
 Fetches the value associated with a key or a default value. More...
 
bool TryGetValue (KeyType key, out ValueType value)
 Get a value if the key is part of the mapping. More...
 

Properties

new ValueType this[KeyType key] [get, set]
 Fetches a or sets a value associated with a key. More...
 
new int Count [get]
 Fetches the number of elements in the map. More...
 
new SCG.IEnumerable< ValueType > Values [get]
 Fetches an iterator for the values in the mapping. More...
 
- Properties inherited from Joutsen.Collections.Generic.Mapping< KeyType, ValueType >
ValueType this[KeyType key] [get]
 Fetches a value associated with a key. More...
 
IEnumerable< KeyType > Keys [get]
 Fetches an iterator for the keys in the mapping. More...
 
IEnumerable< ValueType > Values [get]
 Fetches an iterator for the values in the mapping. More...
 
int Count [get]
 Fetches the number of elements in the mapping. More...
 

Detailed Description

An interface for classes mapping keys to values.

Since
0.4.0

Member Function Documentation

◆ ContainsKey()

new bool Joutsen.Collections.Generic.Map< KeyType, ValueType >.ContainsKey ( KeyType  key)

Checks if a key is part of the map.

Parameters
keythe key to lookup
Returns
true if the key is part of the mapping, false otherwise

Implements Joutsen.Collections.Generic.Mapping< KeyType, ValueType >.

Implemented in Joutsen.Collections.Generic.Compatibility.MapAdapter< KeyType, ValueType >, and Joutsen.Collections.Generic.BidirectionalDictionary< KeyType, ValueType >.

◆ Update()

void Joutsen.Collections.Generic.Map< KeyType, ValueType >.Update ( SCG.IEnumerable< SCG.KeyValuePair< KeyType, ValueType > >  newValues)

Adds or updates values in the map.

Parameters
newValuesthe pairs that are used to modify the map
Remarks
All values whose associated key exists in the map are updated with the new values. Any key that does not exist is added along with the value associated with it. This method does not delete any keys.

Implemented in Joutsen.Collections.Generic.Compatibility.MapAdapter< KeyType, ValueType >, Joutsen.Collections.Concurrent.ConcurrentDictionary< KeyType, ValueType >, Joutsen.Collections.Generic.BidirectionalDictionary< KeyType, ValueType >, Joutsen.Collections.Generic.Dictionary< KeyType, ValueType >, and Joutsen.Collections.Generic.SortedDictionary< KeyType, ValueType >.

Property Documentation

◆ Count

new int Joutsen.Collections.Generic.Map< KeyType, ValueType >.Count
get

◆ this[KeyType key]

new ValueType Joutsen.Collections.Generic.Map< KeyType, ValueType >.this[KeyType key]
getset

◆ Values

new SCG.IEnumerable<ValueType> Joutsen.Collections.Generic.Map< KeyType, ValueType >.Values
get