Return-Path: Delivered-To: apmail-incubator-geronimo-dev-archive@incubator.apache.org Received: (qmail 77424 invoked by uid 500); 14 Aug 2003 12:31:47 -0000 Mailing-List: contact geronimo-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: geronimo-dev@incubator.apache.org Delivered-To: mailing list geronimo-dev@incubator.apache.org Received: (qmail 77410 invoked from network); 14 Aug 2003 12:31:47 -0000 Received: from dsl-217-155-97-60.zen.co.uk (HELO dsl-217-155-97-61.zen.co.uk) (217.155.97.60) by daedalus.apache.org with SMTP; 14 Aug 2003 12:31:47 -0000 Received: from apple.int.bandlem.com ([10.0.0.20] helo=ioshq.com) by dsl-217-155-97-61.zen.co.uk with esmtp (Exim 3.35 #1 (Debian)) id 19nHGd-0002qH-00 for ; Thu, 14 Aug 2003 13:31:47 +0100 Date: Thu, 14 Aug 2003 13:31:50 +0100 Subject: Re: [General] Container interface and AbstractContainer Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v552) From: Alex Blewitt To: geronimo-dev@incubator.apache.org Content-Transfer-Encoding: 7bit In-Reply-To: <69D47C3C-CE52-11D7-ACF2-000A9566A360@coredevelopers.net> Message-Id: <477A5BBB-CE53-11D7-A6C3-0003934D3EA4@ioshq.com> X-Mailer: Apple Mail (2.552) X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N On Thursday, Aug 14, 2003, at 13:25 Europe/London, Jason Dillon wrote: > If the list should not be mutable, then it makes more sense to return > an Iterator (or ListIterator as mentioned), else someone could violate > the contract and insert random fluff into the list instead of using > the add/remove methods. There are things you can do with an immutable list that you can't do with an (List)Iterator. One of them is to find out how big it is (using .size()), another is to add the contents into a new collection( new ArrayList(list)), for example. Whether those methods are needed or not is debatable, but at least if you get the (immutable) list, then you can get the Iterator, ListIterator, size, xxxx etc. Alex.