Java HashMap找到最佳匹配键(Java HashMap find best matching key)
我有一个带有浮点键和字符串值的Java HashMap。 现在给定一个不在HashMap中的Float,我怎么找到与给定的Float最相似的键?
I have a Java HashMap with Float keys and String values. now given a Float which is not in the HashMap, how can i find the key which ist most similar to the given Float?
最满意答案
听起来像是java.util.NavigableMap实现之一的工作。
Sounds like a job for one of the implementations of java.util.NavigableMap.
更多推荐
发布评论