You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Henri Yandell (JIRA)" <ji...@apache.org> on 2008/07/07 16:55:31 UTC

[jira] Closed: (COLLECTIONS-301) Provide SingleValueMap

     [ https://issues.apache.org/jira/browse/COLLECTIONS-301?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell closed COLLECTIONS-301.
-------------------------------------

    Resolution: Won't Fix

It's nothing to do with Map, it's a JVM feature. Primitive wrappers and Strings are, to some extent, pooled in the JVM. 

For String's the feature is called 'interning', as it can be forced with a call to String.intern(). I'm not sure what the state of things is with the primitive wrappers.

> 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.