Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.core.api
Class DocumentTreeIterator

java.lang.Object
  extended by org.nuxeo.ecm.core.api.DocumentTreeIterator
All Implemented Interfaces:
java.util.Iterator<DocumentModel>

public class DocumentTreeIterator
extends java.lang.Object
implements java.util.Iterator<DocumentModel>

An iterator over a tree of documents

The tree is traversed from top to bottom and left to right.

TODO: move this in an utility package

Author:
Bogdan Stefanescu

Constructor Summary
DocumentTreeIterator(CoreSession session, DocumentModel root)
          Creates the iterator given the tree root.
DocumentTreeIterator(CoreSession session, DocumentModel root, boolean excludeRoot)
           
 
Method Summary
 boolean hasNext()
           
 DocumentModel next()
           
 void remove()
           
 void reset()
          Resets the iterator back to the tree root and clear any cached data.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentTreeIterator

public DocumentTreeIterator(CoreSession session,
                            DocumentModel root)
                     throws ClientException
Creates the iterator given the tree root.

Throws:
ClientException

DocumentTreeIterator

public DocumentTreeIterator(CoreSession session,
                            DocumentModel root,
                            boolean excludeRoot)
                     throws ClientException
Throws:
ClientException
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator<DocumentModel>

next

public DocumentModel next()
Specified by:
next in interface java.util.Iterator<DocumentModel>

remove

public void remove()
Specified by:
remove in interface java.util.Iterator<DocumentModel>

reset

public void reset()
Resets the iterator back to the tree root and clear any cached data.


Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.