Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.core.api
Class DocumentTreeIterator

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

public class DocumentTreeIterator
extends Object
implements 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 Iterator<DocumentModel>

next

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

remove

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

reset

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


Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.