Class UnionIterator<E>

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, java.util.Iterator<E>

    public class UnionIterator<E>
    extends LookAheadIterator<E>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Iterator<? extends java.lang.Iterable<? extends E>> argIter  
      private java.util.Iterator<? extends E> currentIter  
    • Constructor Summary

      Constructors 
      Constructor Description
      UnionIterator​(java.lang.Iterable<? extends E>... args)
      Creates a new UnionIterator that returns the bag union of the results of a number of Iterators.
      UnionIterator​(java.lang.Iterable<? extends java.lang.Iterable<? extends E>> args)  
    • Field Detail

      • argIter

        private final java.util.Iterator<? extends java.lang.Iterable<? extends E>> argIter
      • currentIter

        private java.util.Iterator<? extends E> currentIter
    • Constructor Detail

      • UnionIterator

        public UnionIterator​(java.lang.Iterable<? extends E>... args)
        Creates a new UnionIterator that returns the bag union of the results of a number of Iterators.
        Parameters:
        args - The Iterators containing the elements to iterate over.
      • UnionIterator

        public UnionIterator​(java.lang.Iterable<? extends java.lang.Iterable<? extends E>> args)
    • Method Detail

      • getNextElement

        protected E getNextElement()
        Description copied from class: LookAheadIterator
        Gets the next element. Subclasses should implement this method so that it returns the next element.
        Specified by:
        getNextElement in class LookAheadIterator<E>
        Returns:
        The next element, or null if no more elements are available.