我有一个存储了大量的映射从字符串到各种对象的Java程序。
I have a Java program that stores a lot of mappings from Strings to various objects.
现在,我的选择是要么依赖(通过HashMap的)或二进制搜索(通过TreeMap中)散列。我想知道是否有一个流行及品质的集合库的高效,规范线索为基础的Map实现?
Right now, my options are either to rely on hashing (via HashMap) or on binary searches (via TreeMap). I am wondering if there is an efficient and standard trie-based map implementation in a popular and quality collections library?
我已经写了我自己的过去,但我宁愿用什么标准去了,如果有的话。
I've written my own in the past, but I'd rather go with something standard, if available.
快速澄清:虽然我的问题是,一般情况下,在当前项目中,我处理大量的数据,是通过完全限定类名或方法签名索引。因此,有许多共享prefixes。
Quick clarification: While my question is general, in the current project I am dealing with a lot of data that is indexed by fully-qualified class name or method signature. Thus, there are many shared prefixes.
您可能想要看的特里实现,LimeWire的是促进到谷歌番石榴。
You might want to look at the Trie implementation that Limewire is contributing to the Google Guava.