|
Joutsen v0.5.0+12-g5dd5f7e
|
A map implementation that uses the hashes to find keys and values. More...
Public Member Functions | |
| BidirectionalDictionary () | |
| Creates an empty dictionary. More... | |
| BidirectionalDictionary (Mapping< KeyType, ValueType > map) | |
| Creates a new dictionary with predefined entries. More... | |
| BidirectionalDictionary (SCG.IEqualityComparer< KeyType > keyComparer, SCG.IEqualityComparer< ValueType > valueComparer) | |
| Creates a new dictionary using a custom comparers to calculate hashes. More... | |
| BidirectionalDictionary (int initialCapacity) | |
| Creates a new dictionary with a custom initial size of the hash table. More... | |
| BidirectionalDictionary (Mapping< KeyType, ValueType > map, SCG.IEqualityComparer< KeyType > keyComparer, SCG.IEqualityComparer< ValueType > valueComparer) | |
| Creates a new dictionary using predefined initial items and custom comparers to calculate hashes. More... | |
| BidirectionalDictionary (int initialCapacity, SCG.IEqualityComparer< KeyType > keyComparer, SCG.IEqualityComparer< ValueType > valueComparer) | |
| Creates a new dictionary with custom comparers to calculate hashes and a custom internal capacity. More... | |
| void | Add (KeyType key, ValueType value) |
| Adds a new key value pair to the dictionary. More... | |
| bool | ContainsKey (KeyType key) |
| Checks if a key is part of the dictionary. More... | |
| bool | ContainsValue (ValueType value) |
| Checks if a value is part of the dictionary. More... | |
| bool | TryGetValue (KeyType key, out ValueType value) |
| Tries to fetch a value based on a key. More... | |
| ValueType | GetValue (KeyType key, ValueType defaultValue) |
| Fetches the value associated with a key or a default value. More... | |
| bool | TryGetKey (ValueType value, out KeyType key) |
| Tries to fetch a key based on a value. More... | |
| KeyType | GetKey (ValueType value, KeyType defaultKey) |
| Fetches the key associated with a value or a default key. More... | |
| void | Update (SCG.IEnumerable< SCG.KeyValuePair< KeyType, ValueType > > newValues) |
| Adds or updates values in the map. More... | |
| bool | Remove (KeyType key) |
| bool | Remove (ValueType value) |
| void | Clear () |
| Removes all key value pairs. More... | |
| override String | ToString () |
| IEnumerator< KeyValuePair< KeyType, ValueType > > | GetEnumerator () |
| 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... | |
| 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... | |
Public Member Functions inherited from Joutsen.Collections.Generic.Indexable< KeyType, ValueType > | |
| IndexType | IndexOf (ItemType item) |
| Fetches the index of an itemin the list. More... | |
| IndexType | IndexOf (ItemType item, IEqualityComparer< ItemType > comparer) |
| Fetches the index of an item in the list using a custom comparer. More... | |
Properties | |
| SCG.IEnumerable< KeyType > | Keys [get] |
| Returns all the available keys. More... | |
| SCG.IEnumerable< ValueType > | Values [get] |
| Returns all the available values. More... | |
| int | Count [get] |
| Fetches the number of elements in the map. More... | |
| ValueType | this[KeyType key] [get, set] |
| Fetches a value based on the provided key. More... | |
| KeyType | this[ValueType val] [get, set] |
| Fetches a key based on the provided value. More... | |
| bool | IsReadOnly [get] |
Properties inherited from Joutsen.Collections.Generic.Map< KeyType, ValueType > | |
| 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... | |
Properties inherited from Joutsen.Collections.Generic.Indexable< KeyType, ValueType > | |
| int | Count [get] |
| Determines the number of values in the list. More... | |
| ItemType | this[IndexType index] [get] |
| Fetches the value associated with the index. More... | |
A map implementation that uses the hashes to find keys and values.
| Joutsen.Collections.Generic.BidirectionalDictionary< KeyType, ValueType >.BidirectionalDictionary | ( | ) |
Creates an empty dictionary.
| Joutsen.Collections.Generic.BidirectionalDictionary< KeyType, ValueType >.BidirectionalDictionary | ( | Mapping< KeyType, ValueType > | map | ) |
Creates a new dictionary with predefined entries.
| map | the predefined entries of the dictionary |
| Joutsen.Collections.Generic.BidirectionalDictionary< KeyType, ValueType >.BidirectionalDictionary | ( | SCG.IEqualityComparer< KeyType > | keyComparer, |
| SCG.IEqualityComparer< ValueType > | valueComparer | ||
| ) |
Creates a new dictionary using a custom comparers to calculate hashes.
| keyComparer | the custom comparer for the keys |
| valueComparer | the custom comparer for the values |
| Joutsen.Collections.Generic.BidirectionalDictionary< KeyType, ValueType >.BidirectionalDictionary | ( | int | initialCapacity | ) |
Creates a new dictionary with a custom initial size of the hash table.
| initialCapacity | the initial capacity of the internal hashtable |
| Joutsen.Collections.Generic.BidirectionalDictionary< KeyType, ValueType >.BidirectionalDictionary | ( | Mapping< KeyType, ValueType > | map, |
| SCG.IEqualityComparer< KeyType > | keyComparer, | ||
| SCG.IEqualityComparer< ValueType > | valueComparer | ||
| ) |
Creates a new dictionary using predefined initial items and custom comparers to calculate hashes.
| map | the predefined entries of the dictionary |
| keyComparer | the custom comparer for the keys |
| valueComparer | the custom comparer for the values |
| Joutsen.Collections.Generic.BidirectionalDictionary< KeyType, ValueType >.BidirectionalDictionary | ( | int | initialCapacity, |
| SCG.IEqualityComparer< KeyType > | keyComparer, | ||
| SCG.IEqualityComparer< ValueType > | valueComparer | ||
| ) |
Creates a new dictionary with custom comparers to calculate hashes and a custom internal capacity.
| keyComparer | the custom comparer for the keys |
| valueComparer | the custom comparer for the values |
| comparer | the custom comparer |
| void Joutsen.Collections.Generic.BidirectionalDictionary< KeyType, ValueType >.Add | ( | KeyType | key, |
| ValueType | value | ||
| ) |
Adds a new key value pair to the dictionary.
| key | the key that cane be used to find the value |
| value | the value that cane be used to find the key |
| void Joutsen.Collections.Generic.BidirectionalDictionary< KeyType, ValueType >.Clear | ( | ) |
Removes all key value pairs.
| bool Joutsen.Collections.Generic.BidirectionalDictionary< KeyType, ValueType >.ContainsKey | ( | KeyType | key | ) |
Checks if a key is part of the dictionary.
| key | the key to check |
Implements Joutsen.Collections.Generic.Map< KeyType, ValueType >.
| bool Joutsen.Collections.Generic.BidirectionalDictionary< KeyType, ValueType >.ContainsValue | ( | ValueType | value | ) |
Checks if a value is part of the dictionary.
| value | the value to check |
| IEnumerator< KeyValuePair< KeyType, ValueType > > Joutsen.Collections.Generic.BidirectionalDictionary< KeyType, ValueType >.GetEnumerator | ( | ) |
| KeyType Joutsen.Collections.Generic.BidirectionalDictionary< KeyType, ValueType >.GetKey | ( | ValueType | value, |
| KeyType | defaultKey | ||
| ) |
Fetches the key associated with a value or a default key.
| value | the value associated with the key to retrieve |
| defaultKey | the key to return if the value is not found in the map |
| ValueType Joutsen.Collections.Generic.BidirectionalDictionary< KeyType, ValueType >.GetValue | ( | KeyType | key, |
| ValueType | defaultValue | ||
| ) |
Fetches the value associated with a key or a default value.
| key | the key associated with the value to retrieve |
| defaultValue | the value to return if the key is not found in the map |
Implements Joutsen.Collections.Generic.Mapping< KeyType, ValueType >.
| bool Joutsen.Collections.Generic.BidirectionalDictionary< KeyType, ValueType >.Remove | ( | KeyType | key | ) |
| bool Joutsen.Collections.Generic.BidirectionalDictionary< KeyType, ValueType >.Remove | ( | ValueType | value | ) |
| override String Joutsen.Collections.Generic.BidirectionalDictionary< KeyType, ValueType >.ToString | ( | ) |
| bool Joutsen.Collections.Generic.BidirectionalDictionary< KeyType, ValueType >.TryGetKey | ( | ValueType | value, |
| out KeyType | key | ||
| ) |
Tries to fetch a key based on a value.
| value | the value used to find the key |
| key | the output of the the key if it was found |
| bool Joutsen.Collections.Generic.BidirectionalDictionary< KeyType, ValueType >.TryGetValue | ( | KeyType | key, |
| out ValueType | value | ||
| ) |
Tries to fetch a value based on a key.
| key | the key used to find the value |
| value | the output of the the value if it was found |
Implements Joutsen.Collections.Generic.Mapping< KeyType, ValueType >.
| void Joutsen.Collections.Generic.BidirectionalDictionary< KeyType, ValueType >.Update | ( | SCG.IEnumerable< SCG.KeyValuePair< KeyType, ValueType > > | newValues | ) |
Adds or updates values in the map.
| newValues | the pairs that are used to modify the map |
Implements Joutsen.Collections.Generic.Map< KeyType, ValueType >.
|
get |
Fetches the number of elements in the map.
Implements Joutsen.Collections.Generic.Map< KeyType, ValueType >.
|
get |
|
get |
Returns all the available keys.
Implements Joutsen.Collections.Generic.Mapping< KeyType, ValueType >.
|
getset |
Fetches a value based on the provided key.
| key | the key used to find the value |
Implements Joutsen.Collections.Generic.Map< KeyType, ValueType >.
|
getset |
Fetches a key based on the provided value.
| val | the value used to find the key |
|
get |
Returns all the available values.
Implements Joutsen.Collections.Generic.Map< KeyType, ValueType >.