chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Klevenz, Stephan" <>
Subject RE: various small cleanups
Date Thu, 09 Sep 2010 13:52:26 GMT
Hi Florent,

Some comments:

to 1.     +1
to 2.     +1

to 3. I'm not sure if I understand correctly. The reason to return an iterable is to allow
dotted expressions to have some "from-to" semantic of a range: ItemIterable<CmisObject>
i = folder.getChildren().skipTo(2).getPage(3);

to 4. The paging mechanism is quite complex and I will look into this later.


-----Original Message-----
From: Florent Guillaume [] 
Sent: Donnerstag, 9. September 2010 14:54
To: List-Chemistry
Subject: various small cleanups


A few things:

Currently our iterators (CollectionIterator, CollectionPageIterator)
have a next() method that returns null at the end of the iteration.
This is wrong and contrary to the Iterator contract, they should
return NoSuchElementException in that case.
Anyone opposed to fixing this?

Also I'd like to do small renamings like AbstractPageFetch ->
AbstractPageFetcher and PageFetchResult -> FetchedPage or maybe even
Page, and also rename getPage to getItems (or getList).

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?

PageFetchResult has:
    public BigInteger getTotalItems()
    public Boolean getHasMoreItems()
whereas ItemIterable has:
    long getTotalNumItems();
    boolean getHasMoreItems();
I guess we have to keep Boolean and BigInteger to reflect the domain
model here, but I'll sync the naming.



Florent Guillaume, Director of R&D, Nuxeo
Open Source, Java EE based, Enterprise Content Management (ECM)   +33 1 40 33 79 87

View raw message