我在哪里可以找到 Java 中基于 Trie 的标准地图实现? [英] Where do I find a standard Trie based map implementation in Java?

查看:26
本文介绍了我在哪里可以找到 Java 中基于 Trie 的标准地图实现?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Java 程序,它存储了大量从字符串到各种对象的映射.

I have a Java program that stores a lot of mappings from Strings to various objects.

现在,我的选择是依靠散列(通过 HashMap)或二分搜索(通过 TreeMap).我想知道在流行的高质量集合库中是否有一种高效且标准的基于树的地图实现?

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.

快速澄清:虽然我的问题很笼统,但在当前项目中,我正在处理大量由完全限定的类名或方法签名索引的数据.因此,有许多共享前缀.

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 为 Google Guava 贡献的实现.

这篇关于我在哪里可以找到 Java 中基于 Trie 的标准地图实现?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆