Package apoc.bolt

Class ClosedAwareDelegatingIterator<T>

  • Type Parameters:
    T -
    All Implemented Interfaces:
    java.util.Iterator<T>

    public class ClosedAwareDelegatingIterator<T>
    extends java.lang.Object
    implements java.util.Iterator<T>
    if we would pass through a bolt result stream directly as a procedure result stream, there's an issue regarding hasNext() throwing an exception. This wrapper class catches the exception and deals with it gracefully
    • Constructor Detail

      • ClosedAwareDelegatingIterator

        public ClosedAwareDelegatingIterator​(java.util.Iterator<T> delegate)
    • Method Detail

      • hasNext

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

        public T next()
        Specified by:
        next in interface java.util.Iterator<T>
      • remove

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

        public void forEachRemaining​(java.util.function.Consumer<? super T> action)
        Specified by:
        forEachRemaining in interface java.util.Iterator<T>