Closed robross0606 closed 4 years ago
Hello @robross0606. To get a key by value, you need to use the map's inverse
likewise:
bimap.inverse.get(value)
I think this API choice stems from Google's Guava Java library.
Yes, sorry, I just came upon that in the documentation. Would be a pretty good thing to call out specifically in the top level docs for a BiMap implementation.
Indeed. Do you want to open a PR adding an example in the docs (in the gh-pages
) if you have some time to spare?
Typically, a BiMap allows you to look up a value by key, or a key by value. However, I don't see the ability in this API to get a key by value. Am I missing something? That seems like a pretty crucial feature to be missing from a BiMap.