I'm a geek who has worked with computers since before I care to remember. Went though various IT roles, from desktop support, sys/net admin, software QA, and currently in the role of SDET.
Thanks for the writeup. This is intriguing as I've had moments where I would've liked to use something similar where I'd look up the key by giving a value. In this Bidirectional Map, are the keys and values required to be unique? If we have two keys with the same value, would this not cause a problem if we tried to look up the keys by the value?
Thanks for the writeup. This is intriguing as I've had moments where I would've liked to use something similar where I'd look up the key by giving a value. In this Bidirectional Map, are the keys and values required to be unique? If we have two keys with the same value, would this not cause a problem if we tried to look up the keys by the value?
Yeah, indeed keys and values required to be unique.
As you can see in current implementation,
set
method will throw an error in case if map already consists key or value.