Class LazyItemIterator

  • All Implemented Interfaces:
    Iterator, NodeIterator, PropertyIterator, RangeIterator

    public class LazyItemIterator
    extends Object
    implements NodeIterator, PropertyIterator
    LazyItemIterator is an id-based iterator that instantiates the Items 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 by getSize() might appear to be shrinking while iterating over the items. todo should getSize() better always return -1?

    See Also:
    getSize()
    • Constructor Detail

      • LazyItemIterator

        public LazyItemIterator​(SessionContext sessionContext,
                                List<? extends ItemId> idList)
        Creates a new LazyItemIterator instance.
        Parameters:
        sessionContext - session context
        idList - list of item id's
      • LazyItemIterator

        public LazyItemIterator​(SessionContext sessionContext,
                                List<? extends ItemId> idList,
                                NodeId parentId)
        Creates a new LazyItemIterator instance, additionally taking a parent id as parameter. This version should be invoked to strictly return children nodes of a node.
        Parameters:
        sessionContext - session context
        idList - list of item id's
        parentId - parent id.