Class JoinedIterator<T>

  • All Implemented Interfaces:
    Iterator<T>

    public class JoinedIterator<T>
    extends Object
    implements Iterator<T>
    An Iterator implementation that wraps other Iterators, and presents them all as one continuous Iterator. When any method from Iterator is called, we delegate to each wrapped Iterator in turn until all wrapped Iterators are exhausted.
    • Constructor Detail

      • JoinedIterator

        public JoinedIterator​(List<Iterator<T>> wrappedIterators)
    • Method Detail

      • hasNext

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

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

        public void remove()
        Specified by:
        remove in interface Iterator<T>
      • updateCurrentIterator

        protected void updateCurrentIterator()