I guess both are useful;  but what is the underlying storage?
If it's a HashMap, then this should be called something like
ReverseHashMap.  (Or ReversibleHashMap?)

-- Adam


On 10/24/06, Arjuna Wijeyekoon <[EMAIL PROTECTED]> wrote:
Hi,
I'd like to make
org.apache.myfaces.trinidad.component.ValueMap
a public utility class.

This class maintains a mapping from key to value, and also from value to
key. It is useful to create
ClientRowKeyManager implementations (See
http://issues.apache.org/jira/browse/ADFFACES-210).

I'd like to call it
org.apache.myfaces.trinidad.util.ReverseMap

And I will cleanup the api so that the Map interface is fully implemented
(along with the remove operations).

What do you think about making this class public?
??????




If we do make this public, which of the following apis is better?
ReverseMap<K,V> map;
V value;
K key = map.getKey(value);    // option 1
or
Map<V,K> valuemap = map.getReverseMap();     //  option 2
K Key = valuemap.get(value);
???

or should we have both?

--arjuna


Reply via email to