This is a dictionary guaranteed to have only one of each value and key. It may be searched either by TFirst or by TSecond, giving a unique answer because it is 1 to 1.
More...
|
void | Add (TFirst first, TSecond second) |
| Tries to add the pair to the dictionary. Throws an exception if either element is already in the dictionary More...
|
|
void | Clear () |
| Removes all items from the dictionary. More...
|
|
TSecond | GetByFirst (TFirst first) |
| Find the TSecond corresponding to the TFirst first Throws an exception if first is not in the dictionary. More...
|
|
TFirst | GetBySecond (TSecond second) |
| Find the TFirst corresponing to the Second second. Throws an exception if second is not in the dictionary. More...
|
|
void | RemoveByFirst (TFirst first) |
| Remove the record containing first. If first is not in the dictionary, throws an Exception. More...
|
|
void | RemoveBySecond (TSecond second) |
| Remove the record containing second. If second is not in the dictionary, throws an Exception. More...
|
|
Boolean | TryAdd (TFirst first, TSecond second) |
| Tries to add the pair to the dictionary. Returns false if either element is already in the dictionary More...
|
|
Boolean | TryGetByFirst (TFirst first, out TSecond second) |
| Find the TSecond corresponding to the TFirst first. Returns false if first is not in the dictionary. More...
|
|
Boolean | TryGetBySecond (TSecond second, out TFirst first) |
| Find the TFirst corresponding to the TSecond second. Returns false if second is not in the dictionary. More...
|
|
Boolean | TryRemoveByFirst (TFirst first) |
| Remove the record containing first, if there is one. More...
|
|
Boolean | TryRemoveBySecond (TSecond second) |
| Remove the record containing second, if there is one. More...
|
|
|
IDictionary< TFirst, TSecond > | firstToSecond = new Dictionary<TFirst, TSecond>() |
|
IDictionary< TSecond, TFirst > | secondToFirst = new Dictionary<TSecond, TFirst>() |
|
|
Int32 | Count [get] |
| The number of pairs stored in the dictionary More...
|
|
This is a dictionary guaranteed to have only one of each value and key. It may be searched either by TFirst or by TSecond, giving a unique answer because it is 1 to 1.
- Template Parameters
-
TFirst | The type of the "key" |
TSecond | The type of the "value" |
void BiDictionaryOneToOne< TFirst, TSecond >.Add |
( |
TFirst |
first, |
|
|
TSecond |
second |
|
) |
| |
|
inline |
Tries to add the pair to the dictionary. Throws an exception if either element is already in the dictionary
- Parameters
-
void BiDictionaryOneToOne< TFirst, TSecond >.Clear |
( |
| ) |
|
|
inline |
Removes all items from the dictionary.
TSecond BiDictionaryOneToOne< TFirst, TSecond >.GetByFirst |
( |
TFirst |
first | ) |
|
|
inline |
Find the TSecond corresponding to the TFirst first Throws an exception if first is not in the dictionary.
- Parameters
-
first | the key to search for |
- Returns
- the value corresponding to first
TFirst BiDictionaryOneToOne< TFirst, TSecond >.GetBySecond |
( |
TSecond |
second | ) |
|
|
inline |
Find the TFirst corresponing to the Second second. Throws an exception if second is not in the dictionary.
- Parameters
-
second | the key to search for |
- Returns
- the value corresponding to second
void BiDictionaryOneToOne< TFirst, TSecond >.RemoveByFirst |
( |
TFirst |
first | ) |
|
|
inline |
Remove the record containing first. If first is not in the dictionary, throws an Exception.
- Parameters
-
first | the key of the record to delete |
void BiDictionaryOneToOne< TFirst, TSecond >.RemoveBySecond |
( |
TSecond |
second | ) |
|
|
inline |
Remove the record containing second. If second is not in the dictionary, throws an Exception.
- Parameters
-
second | the key of the record to delete |
Boolean BiDictionaryOneToOne< TFirst, TSecond >.TryAdd |
( |
TFirst |
first, |
|
|
TSecond |
second |
|
) |
| |
|
inline |
Tries to add the pair to the dictionary. Returns false if either element is already in the dictionary
- Parameters
-
- Returns
- true if successfully added, false if either element are already in the dictionary
Boolean BiDictionaryOneToOne< TFirst, TSecond >.TryGetByFirst |
( |
TFirst |
first, |
|
|
out TSecond |
second |
|
) |
| |
|
inline |
Find the TSecond corresponding to the TFirst first. Returns false if first is not in the dictionary.
- Parameters
-
first | the key to search for |
second | the corresponding value |
- Returns
- true if first is in the dictionary, false otherwise
Boolean BiDictionaryOneToOne< TFirst, TSecond >.TryGetBySecond |
( |
TSecond |
second, |
|
|
out TFirst |
first |
|
) |
| |
|
inline |
Find the TFirst corresponding to the TSecond second. Returns false if second is not in the dictionary.
- Parameters
-
second | the key to search for |
first | the corresponding value |
- Returns
- true if second is in the dictionary, false otherwise
Boolean BiDictionaryOneToOne< TFirst, TSecond >.TryRemoveByFirst |
( |
TFirst |
first | ) |
|
|
inline |
Remove the record containing first, if there is one.
- Parameters
-
- Returns
- If first is not in the dictionary, returns false, otherwise true
Boolean BiDictionaryOneToOne< TFirst, TSecond >.TryRemoveBySecond |
( |
TSecond |
second | ) |
|
|
inline |
Remove the record containing second, if there is one.
- Parameters
-
- Returns
- If second is not in the dictionary, returns false, otherwise true
IDictionary<TFirst, TSecond> BiDictionaryOneToOne< TFirst, TSecond >.firstToSecond = new Dictionary<TFirst, TSecond>() |
IDictionary<TSecond, TFirst> BiDictionaryOneToOne< TFirst, TSecond >.secondToFirst = new Dictionary<TSecond, TFirst>() |
Int32 BiDictionaryOneToOne< TFirst, TSecond >.Count |
|
get |
The number of pairs stored in the dictionary
The documentation for this class was generated from the following file: