Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 74951 invoked from network); 19 Sep 2002 12:18:06 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 19 Sep 2002 12:18:06 -0000 Received: (qmail 2660 invoked by uid 97); 19 Sep 2002 12:18:41 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@jakarta.apache.org Received: (qmail 2541 invoked by uid 97); 19 Sep 2002 12:18:39 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 2502 invoked by uid 98); 19 Sep 2002 12:18:38 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Message-ID: <3E77AFA3658B514B9D8BB982ADDC934E3BF386@chiex02.britannica.net> From: "Waldhoff, Rodney" To: "'commons-dev@jakarta.apache.org '" Subject: RE: [collections] MapUtils.swapsKeysValues() Date: Thu, 19 Sep 2002 07:17:49 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2656.59) List-Subscribe: Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C25FD6.91B87460" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ------_=_NextPart_001_01C25FD6.91B87460 Content-Type: text/plain; charset="iso-8859-1" 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? ------_=_NextPart_001_01C25FD6.91B87460--