Class MultiIterator<T>

  • Type Parameters:
    T - The element type of the iterator
    All Implemented Interfaces:
    java.util.Iterator<T>

    public class MultiIterator<T>
    extends java.lang.Object
    implements java.util.Iterator<T>
    An Iterator that traverses a Collection of Iterators, Collections and/or arrays.
    • Constructor Summary

      Constructors 
      Constructor Description
      MultiIterator​(java.lang.Object[] array)  
      MultiIterator​(java.lang.Object[][] arrays)  
      MultiIterator​(java.lang.Object object, java.util.Collection<T> collection)
      Iterates over the given Collection, prepended with the given Object.
      MultiIterator​(java.lang.Object prefix, java.util.Iterator<T> iterator)
      Iterates over the given Iterator, prepended with the given prefix.
      MultiIterator​(java.util.Collection<?> collection)  
      MultiIterator​(java.util.Collection<T>[] collections)  
      MultiIterator​(java.util.Collection<T> collection, java.lang.Object object)
      Iterates over the given Collection, appended with the given Object.
      MultiIterator​(java.util.Iterator<?> iterator)  
      MultiIterator​(java.util.Iterator<T>[] iterators)  
      MultiIterator​(java.util.Iterator<T> iterator, java.lang.Object suffix)
      Iterates over the given Iterator, appended with the given suffix.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean hasNext()  
      T next()  
      void remove()  
      • 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

      • MultiIterator

        public MultiIterator​(java.util.Iterator<T>[] iterators)
        Parameters:
        iterators - An array of Iterators
      • MultiIterator

        public MultiIterator​(java.util.Collection<T>[] collections)
        Parameters:
        collections - An array of Collections
      • MultiIterator

        public MultiIterator​(java.lang.Object[][] arrays)
        Parameters:
        arrays - An array of arrays
      • MultiIterator

        public MultiIterator​(java.util.Collection<?> collection)
        Parameters:
        collection - A Collection of Collections, Iterators and/or arrays
      • MultiIterator

        public MultiIterator​(java.util.Iterator<?> iterator)
        Parameters:
        iterator - An iterator over Collections, Iterators and/or arrays
      • MultiIterator

        public MultiIterator​(java.lang.Object[] array)
        Parameters:
        array - An array of Collections, Iterators and/or arrays
      • MultiIterator

        public MultiIterator​(java.lang.Object object,
                             java.util.Collection<T> collection)
        Iterates over the given Collection, prepended with the given Object.
      • MultiIterator

        public MultiIterator​(java.util.Collection<T> collection,
                             java.lang.Object object)
        Iterates over the given Collection, appended with the given Object.
      • MultiIterator

        public MultiIterator​(java.lang.Object prefix,
                             java.util.Iterator<T> iterator)
        Iterates over the given Iterator, prepended with the given prefix.
      • MultiIterator

        public MultiIterator​(java.util.Iterator<T> iterator,
                             java.lang.Object suffix)
        Iterates over the given Iterator, appended with the given suffix.
    • 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>