Interface IMap<TLeft, TRight>
Represents a collection of two types of values that map between each other in a bidirectional one-to-one relationship. Values on each side of the map must be unique on their respective side.
Inherited Members
Namespace: Singulink.Collections
Assembly: Singulink.Collections.dll
Syntax
public interface IMap<TLeft, TRight> : ICollection<KeyValuePair<TLeft, TRight>>, IEnumerable<KeyValuePair<TLeft, TRight>>, IEnumerable
Type Parameters
Name | Description |
---|---|
TLeft | The type of values on the left side of the map. |
TRight | The type of values on the right side of the map. |
Properties
Name | Description |
---|---|
this[TLeft] | Gets or sets the right value associated with the specified left value. |
LeftValues | Gets the values on the left side of the map. |
Reverse | Gets the reverse map where the left and right side are flipped. |
RightValues | Gets the values on the right side of the map. |
Methods
Name | Description |
---|---|
Add(TLeft, TRight) | Adds an association to map between the specified left and right value. |
Contains(TLeft, TRight) | Gets a value indicating if the map contains an association between the specified left and right value. |
ContainsLeft(TLeft) | Determines whether this map contains the specified left value. |
ContainsRight(TRight) | Determines whether this map contains the specified right value. |
Remove(TLeft, TRight) | Removes an association from the map between the specified left and right value if they currently map to each other and returns true if removal was successful. If the left and right values do not map to each other then no changes are made and false is returned. |
RemoveLeft(TLeft) | Removes an association from the map given the specified left value. |
RemoveRight(TRight) | Removes an association from the map given the specified right value. |
Set(TLeft, TRight) | Sets an association on the map between the specified left and right value, overriding any previous associations these values had. |
TryGetLeftValue(TRight, out TLeft) | Gets the right value associated with the specified left value. |
TryGetRightValue(TLeft, out TRight) | Gets the right value associated with the specified left value. |