Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 93529 invoked from network); 3 Jul 2006 16:57:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 3 Jul 2006 16:57:27 -0000 Received: (qmail 39691 invoked by uid 500); 3 Jul 2006 16:57:25 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 39266 invoked by uid 500); 3 Jul 2006 16:57:23 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: 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 39255 invoked by uid 99); 3 Jul 2006 16:57:23 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jul 2006 09:57:23 -0700 X-ASF-Spam-Status: No, hits=1.9 required=10.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_POST X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [217.146.188.128] (HELO web86503.mail.ird.yahoo.com) (217.146.188.128) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 03 Jul 2006 09:57:22 -0700 Received: (qmail 97111 invoked by uid 60001); 3 Jul 2006 16:56:50 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=btopenworld.com; h=Message-ID:Received:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=NEzPTcvTLd/EL4mxrdKcfHIxttBNoSm69THIoni7t3hymNXtZMhv0shaE4p4JfbF86hGVZon5EGjyGt4GvAJJCfpgBPTY1hjm2UHGTKFvhROcy98xC7XYVeE6ckC1XS2U9Q5DhinnvyaUnKEaM6AuNxIyYMFI0rD2gp0P4f1ZDA= ; Message-ID: <20060703165650.97105.qmail@web86503.mail.ird.yahoo.com> Received: from [194.164.132.240] by web86503.mail.ird.yahoo.com via HTTP; Mon, 03 Jul 2006 16:56:50 GMT Date: Mon, 3 Jul 2006 16:56:50 +0000 (GMT) From: Stephen Colebourne Reply-To: Stephen Colebourne Subject: Re: [collections] New methods To: Jakarta Commons Developers List In-Reply-To: <009701c69ebe$249cd2b0$6b01a8c0@CARMANI9300> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N > ListUtils.forceSize(List list, int size) > - trims list size to size if too large > - adds extra nulls to the list if its too small My original proposal was to have one method that trims if too large and grows if too small. So, perhaps there are three methods in total - trim, grow, forceSize Stephen ----- Original Message ---- From: James Carman You can't do a resize method because the code won't know which way you want to go with it. For instance, if you ask it to resize(list, 10) and the list has 20 elements in it, does that mean that you want it to trim it back so that it only contains 10 elements? Or, does that mean that it's okay, because it already has at least 10 elements in it? So, I'm cool with having two methods here. One for shrinking and one for growing (if necessary). +1 on not needing the ListUtils.copy() method, since the core API provides it. +1 on the obscurity of the merge() method. That doesn't sound like a common enough requirement to be on commons collections. -----Original Message----- From: Henri Yandell [mailto:flamefew@gmail.com] Sent: Monday, July 03, 2006 12:13 PM To: Jakarta Commons Developers List Subject: Re: [collections] New methods On 7/3/06, Stephen Colebourne wrote: > Some possible new methods for [collections] > > ListUtils.trimSize(List list, int size) > - trims list size to size if too large > > ListUtils.forceSize(List list, int size) > - trims list size to size if too large > - adds extra nulls to the list if its too small Would it be bad to just have the one method that both enlarged and shrunk? resize(LIst, int) or something? > ListUtils.copy(List,Object[]) > - copy a collection into an array java.util.Collection.toArray() ? > ListUtils.merge(List list, List defaultValues) > - replace any null values in list with the matching index in defaultValues Do you think this is something people will need often? Seems likely to be quite rare. Hen --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org