首页 > 代码库 > Guava bimap
Guava bimap
A bimap (or "bidirectional map") is a map that preserves the uniqueness of
its values as well as that of its keys. This constraint enables bimaps to
support an "inverse view", which is another bimap containing the same entries
as this bimap but with reversed keys and values.
从注释来看,一个biMap是一个值有唯一性的Map。可以通过inverse()方法进行key与value的反转。
如果put操作时,插入不同key的相同value值,那么会抛出“Exception in thread "main" java.lang.IllegalArgumentException: value already present:”异常
Guava bimap
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。