Interface IMap<TLeft, TRight>
Represents a bidirectional one-to-one mapping between two sets of values. Values on each side of the map must be unique within their respective side.
Inherited Members
Namespace: Singulink.Collections
Assembly: Singulink.Collections.dll
Syntax
public interface IMap<TLeft, TRight> : IReadOnlyMap<TLeft, TRight>, IReadOnlyCollection<KeyValuePair<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 |
|---|---|
| Count | Gets the number of associations in the map. |
| this[TLeft] | Gets or sets the right value associated with the specified left value. |
| Reverse | Gets a view of this map with the left and right sides swapped. |
Methods
| Name | Description |
|---|---|
| Add(TLeft, TRight) | Adds an association between the specified left and right values to the map. |
| Remove(TLeft, TRight) | Removes the association between the specified left and right values from the map if they are currently associated with each other. |
| RemoveLeft(TLeft) | Removes the association containing the specified left value from the map. |
| RemoveRight(TRight) | Removes the association containing the specified right value from the map. |
| Set(TLeft, TRight) | Sets an association between the specified left and right values, overriding any existing associations involving either value. |
| TryAdd(TLeft, TRight) | Attempts to add an association between the specified left and right values to the map. |