From chemistry-dev-return-2109-apmail-incubator-chemistry-dev-archive=incubator.apache.org@incubator.apache.org Thu Sep 09 14:24:08 2010 Return-Path: Delivered-To: apmail-incubator-chemistry-dev-archive@minotaur.apache.org Received: (qmail 16932 invoked from network); 9 Sep 2010 14:24:08 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 Sep 2010 14:24:08 -0000 Received: (qmail 42628 invoked by uid 500); 9 Sep 2010 14:24:08 -0000 Delivered-To: apmail-incubator-chemistry-dev-archive@incubator.apache.org Received: (qmail 42501 invoked by uid 500); 9 Sep 2010 14:24:06 -0000 Mailing-List: contact chemistry-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: chemistry-dev@incubator.apache.org Delivered-To: mailing list chemistry-dev@incubator.apache.org Received: (qmail 42314 invoked by uid 99); 9 Sep 2010 14:24:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Sep 2010 14:24:04 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of fguillaume@nuxeo.com designates 209.85.160.175 as permitted sender) Received: from [209.85.160.175] (HELO mail-gy0-f175.google.com) (209.85.160.175) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Sep 2010 14:24:00 +0000 Received: by gya6 with SMTP id 6so679062gya.6 for ; Thu, 09 Sep 2010 07:23:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.102.83.18 with SMTP id g18mr155359mub.56.1284042218669; Thu, 09 Sep 2010 07:23:38 -0700 (PDT) Received: by 10.102.135.23 with HTTP; Thu, 9 Sep 2010 07:23:38 -0700 (PDT) In-Reply-To: References: Date: Thu, 9 Sep 2010 16:23:38 +0200 Message-ID: Subject: Re: various small cleanups From: Florent Guillaume To: chemistry-dev@incubator.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Thu, Sep 9, 2010 at 3:52 PM, Klevenz, Stephan wrote: >Florent wrote: >> 3. >> ItemIterable.skipTo returns a new iterable. I'm used to skipTo methods >> that just modify the iterable in place (for instance the JCR >> RangeIterator.skip or JCR2 EventJournal.skipTo or Lucene Spans.skipTo >> and TermDocs.skipTo), and in the use cases I've seen it's no use >> creating a new object. Is it ok to change this? > > to 3. I'm not sure if I understand correctly. The reason to return an ite= rable is to allow dotted expressions to have some "from-to" semantic of a r= ange: ItemIterable i =3D folder.getChildren().skipTo(2).getPage= (3); Returning an object for chained expressions is all right, but what I want to ensure is that the contract of the method allows it to return "this" after modifying its internal state, and to change the implementation to that effect to avoid constructing new objects every time. Florent --=20 Florent Guillaume, Director of R&D, Nuxeo Open Source, Java EE based, Enterprise Content Management (ECM) http://www.nuxeo.com=A0=A0 http://www.nuxeo.org=A0=A0 +33 1 40 33 79 87