commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Waldhoff, Rodney" <rwald...@us.britannica.com>
Subject RE: [collections] MapUtils.swapsKeysValues()
Date Thu, 19 Sep 2002 12:17:49 GMT
It seems to me this is only meaningful when (or at least, this is only a
correct implementation when) the Map is a bijection--with a one-to-one
mapping between keys and values.  Otherwise some keys in the source map will
not appear as values in the destination map, and which keys disappear will
be dependent upon the order they are returned by the iterator.

I don't know what your use case is, but I think I'd rather see an explict
bijection class (extends Map) that supports this functionality than a
MapUtils method that is only meaningful for a subset of Maps.

What do you think?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message