Bidirectional Map
A bidirectional map. Each key-value-pair gets mapped in both directions. Keys and values must be unique in the sense that there must not be a duplicate key in the domain, nor a duplicate value in the coDomain, but the same element may appear once as key and once as value.
Example:
A -> B
A -> C
is invalid because A is contained twice in the Domain.
A -> B
C -> B
is invalid because B is contained twice in the coDomain.
A -> B
C -> A
is valid because A is only contained once in the domain and in the coDomain.
Parameters
Type of domain elements.
Type of co-domain elements.
Elements to be initialized in the map.
Constructors
Functions
Backward lookup for entry.
Returns whether a relation * -> B exists.
Returns whether a relation A -> * exists.
Forward lookup for entry.
Returns the coDomain of this map as a set.
Returns whether this map contains elements.
Removes by backward lookup. Removes relation * -> B.
Removes by forward lookup. Removes relation A -> * if it exists.