Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 17977 invoked from network); 18 Oct 2003 09:49:29 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 18 Oct 2003 09:49:29 -0000 Received: (qmail 43943 invoked by uid 500); 18 Oct 2003 09:48:59 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 43862 invoked by uid 500); 18 Oct 2003 09:48:59 -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 43849 invoked from network); 18 Oct 2003 09:48:59 -0000 Received: from unknown (HELO protactinium.btinternet.com) (194.73.73.176) by daedalus.apache.org with SMTP; 18 Oct 2003 09:48:59 -0000 Received: from host81-129-74-38.in-addr.btopenworld.com ([81.129.74.38] helo=oemcomputer) by protactinium.btinternet.com with smtp (Exim 3.22 #23) id 1AAnhw-0007UG-00 for commons-dev@jakarta.apache.org; Sat, 18 Oct 2003 10:49:12 +0100 Message-ID: <004901c3955d$c4410b00$264a8151@oemcomputer> From: "Stephen Colebourne" To: "Jakarta Commons Developers List" Subject: [primitives] Proposed interface changes Date: Sat, 18 Oct 2003 10:54:04 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N I would like to propose the following changes for the primitives code as we establish it: New interface Collectable (better names?). Superinterface of XxxCollection and XxxMap - size() - clear() - isEmpty() There are so many times that I've needed a shared interface between Collection and Map - clone() Fix a JDK error - isModifiable() This would be nice to know - optimize() For example, implemented as a trimToSize New interface PCollection (or PrimitiveCollection): - toCollection() It should be really easy to get a JDK collection from a [primitives] one. New methods on IntCollection (et al): - addAll(int[]) - removeAll(int[]) - containsAll(int[]) Primitive handling is often done with arrays at present, so provide good integration - toArray(int[], int) Offers a way to get the primitives into a specific index in an existing array. New interface PList (or PrimitiveList): - toList() It should be really easy to get a JDK collection from a [primitives] one. - removeRange(int, int) Although possible via subList(), this is quicker and more obvious New methods on IntList (et al): - first() - last() Because list.get(list.size() - 1) is a pain - indexOf(int, int) - lastIndexOf(int, int) Completes the set of index methods as per String - addAll(int, int[]) Primitive handling is often done with arrays at present, so provide good integration IMO, these represent a balanced extension to the JDK collection design to fit well in the primitives problem space. Opinions welcome. Stephen --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org