Package org.apache.jackrabbit.core
Class LazyItemIterator
- java.lang.Object
-
- org.apache.jackrabbit.core.LazyItemIterator
-
- All Implemented Interfaces:
Iterator,NodeIterator,PropertyIterator,RangeIterator
public class LazyItemIterator extends Object implements NodeIterator, PropertyIterator
LazyItemIteratoris an id-based iterator that instantiates theItems only when they are requested.Important:
Items that appear to be nonexistent for some reason (e.g. because of insufficient access rights or because they have been removed since the iterator has been retrieved) are silently skipped. As a result the size of the iterator as reported bygetSize()might appear to be shrinking while iterating over the items. todo should getSize() better always return -1?- See Also:
getSize()
-
-
Constructor Summary
Constructors Constructor Description LazyItemIterator(SessionContext sessionContext, List<? extends ItemId> idList)Creates a newLazyItemIteratorinstance.LazyItemIterator(SessionContext sessionContext, List<? extends ItemId> idList, NodeId parentId)Creates a newLazyItemIteratorinstance, additionally taking a parent id as parameter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetPosition()longgetSize()booleanhasNext()Objectnext()NodenextNode()PropertynextProperty()voidremove()voidskip(long skipNum)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Constructor Detail
-
LazyItemIterator
public LazyItemIterator(SessionContext sessionContext, List<? extends ItemId> idList)
Creates a newLazyItemIteratorinstance.- Parameters:
sessionContext- session contextidList- list of item id's
-
LazyItemIterator
public LazyItemIterator(SessionContext sessionContext, List<? extends ItemId> idList, NodeId parentId)
Creates a newLazyItemIteratorinstance, additionally taking a parent id as parameter. This version should be invoked to strictly return children nodes of a node.- Parameters:
sessionContext- session contextidList- list of item id'sparentId- parent id.
-
-
Method Detail
-
nextNode
public Node nextNode()
- Specified by:
nextNodein interfaceNodeIterator
-
nextProperty
public Property nextProperty()
- Specified by:
nextPropertyin interfacePropertyIterator
-
getPosition
public long getPosition()
- Specified by:
getPositionin interfaceRangeIterator
-
getSize
public long getSize()
Note that the size of the iterator as reported by
getSize()might appear to be shrinking while iterating because items that for some reason cannot be retrieved through this iterator are silently skipped, thus reducing the size of this iterator. todo better to always return -1?- Specified by:
getSizein interfaceRangeIterator
-
skip
public void skip(long skipNum)
- Specified by:
skipin interfaceRangeIterator
-
remove
public void remove()
- Specified by:
removein interfaceIterator- Throws:
UnsupportedOperationException- always since not implemented
-
-