Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 44232 invoked from network); 1 Apr 2008 01:04:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Apr 2008 01:04:48 -0000 Received: (qmail 8426 invoked by uid 500); 1 Apr 2008 01:04:39 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 8351 invoked by uid 500); 1 Apr 2008 01:04:39 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 8341 invoked by uid 99); 1 Apr 2008 01:04:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 31 Mar 2008 18:04:39 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [64.233.184.235] (HELO wr-out-0506.google.com) (64.233.184.235) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Apr 2008 01:03:58 +0000 Received: by wr-out-0506.google.com with SMTP id 36so1044989wra.24 for ; Mon, 31 Mar 2008 18:04:09 -0700 (PDT) Received: by 10.140.134.15 with SMTP id h15mr3903022rvd.48.1207011849154; Mon, 31 Mar 2008 18:04:09 -0700 (PDT) Received: by 10.140.140.8 with HTTP; Mon, 31 Mar 2008 18:04:09 -0700 (PDT) Message-ID: Date: Mon, 31 Mar 2008 22:04:09 -0300 From: "Pedro Pedruzzi" To: user@commons.apache.org Subject: [Collections] "For each pair" iterator In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Virus-Checked: Checked by ClamAV on apache.org Hi guys, I have a java.util.Set and I'd like to do a iteration like "for each to distinct pair of elements" do something. In this case I don't care for the ordering of the pair. A most precise way would be: "for each subset of size 2" do something. Do the Apache Commons Collections provide some class to do this? Thanks in advance, -- Pedro Pedruzzi | V2COM | +55 11 3094-3939 --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org