[
https://issues.apache.org/jira/browse/COLLECTIONS-301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12610721#action_12610721
]
Henri Yandell commented on COLLECTIONS-301:
-------------------------------------------
A normal map would also contain only one copy of that value as it would be
String interned. The same would hold for other primitive wrapper classes - the
JVM often ensures that they are the same Object instance.
> Provide SingleValueMap
> ----------------------
>
> Key: COLLECTIONS-301
> URL: https://issues.apache.org/jira/browse/COLLECTIONS-301
> Project: Commons Collections
> Issue Type: New Feature
> Components: Map
> Affects Versions: 3.2
> Reporter: Michael
>
> I miss an efficient implementation of a SingleValueMap.
> The idea goes as follows:
> Map<String, String> map = new SingleValueMap<String, String>();
> map.put("hello","greeting");
> map.put("hola","greeting");
> map.put("hallo",greeting");
> a normal map would now hold three copies of "greeting". A SingleValueMap
> would contain only one copy of this value. All keys would map to one copy,
> identically to a N:1 relaton.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.