码迷,mamicode.com
首页 > 其他好文 > 详细

Guava bimap

时间:2017-05-14 16:54:29      阅读:260      评论:0      收藏:0      [点我收藏+]

标签:ons   ever   trie   direct   nes   imap   res   thread   sam   

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

标签:ons   ever   trie   direct   nes   imap   res   thread   sam   

原文地址:http://www.cnblogs.com/shuada/p/6852803.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!