de.caff.generics

## Class ConcatenatedIterators<T>

- java.lang.Object
- - de.caff.generics.ConcatenatedIterators<T>

- Type Parameters:
    `T` - type of iterator
  All Implemented Interfaces:
    java.util.Iterator<T>

      public class ConcatenatedIterators<T>
      extends java.lang.Object
      implements java.util.Iterator<T>

  Concatenated iterators.

  This allows to iterate over several iterators one after the other in one iteration. It just provides a view and does no additional copying.

  This class is not thread-safe!

  Since:
    August.04, 2016
  Author:
    Rammi

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConcatenatedIterators(java.lang.Iterable<? extends java.util.Iterator<? extends T>> iterators)` Constructor.
    `ConcatenatedIterators(java.util.Iterator<? extends T>... iterators)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `hasNext()` Returns `true` if the iteration has more elements.
    `T` | `next()` Returns the next element in the iteration.

    - ### 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, remove`

- - ### Constructor Detail

    - #### ConcatenatedIterators

          @SafeVarargs
          public ConcatenatedIterators(java.util.Iterator<? extends T>... iterators)

      Constructor.
      Parameters:
        `iterators` - iterators to iterate over
      See Also:
        `Types.concat(Iterator[])`

    - #### ConcatenatedIterators

          public ConcatenatedIterators(@NotNull
                                       java.lang.Iterable<? extends java.util.Iterator<? extends T>> iterators)

      Constructor.
      Parameters:
        `iterators` - iterators to iterate over
      See Also:
        `Types.concatIterators(Iterable)`

  - ### Method Detail

    - #### hasNext

          public boolean hasNext()

      Returns `true` if the iteration has more elements. (In other words, returns `true` if `next()` would return an element rather than throwing an exception.)
      Specified by:
        `hasNext` in interface `java.util.Iterator<T>`
      Returns:
        `true` if the iteration has more elements

    - #### next

          public T next()

      Returns the next element in the iteration.
      Specified by:
        `next` in interface `java.util.Iterator<T>`
      Returns:
        the next element in the iteration
      Throws:
        `java.util.NoSuchElementException` - if the iteration has no more elements