Hi

Am 31.07.2014 um 09:12 schrieb Bertrand De Coatpont <[email protected]>:

> Hello,
> 
> In the JCR world, is there a specific API to obtain (for reading) a
> specific range of child nodes within a large list of orderable child nodes
> (e.g. Nodes 490-500 out of 20000), and is OAK helping/changing anything in
> this area compared to previous versions?

Node.getNodes() returns the children as a NodeIterator which is a 
RangeIterator, which has the skip(long), long getSize(), and long getPosition() 
methods. So, you might check this:

    try {
        NodeIterator children = node.getNodes();
        children.skip(490);
        for (int i=0; i < 10; i++) {
            Node child = children.nextNode();
            // do something useful
        }
    } catch (NoSuchElementException nse) {
        // if there are less than 490 elements
    } catch (RepositoryException re) {
        // oh well :-)
    }

Hope this helps

Regards
Felix

> 
> Thanks!
> 
> Bertrand
> 
> Bertrand de Coatpont
> Group Product Manager, Adobe Experience Management
> Adobe 
> 512.284.4195 (tel), /bertranddecoatpont
> [email protected]
> www.adobe.com
> 
> 
>> 
> 

Reply via email to