de.caff.generics

## Class SingletonIterator<T>

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

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

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

  An iterator which iterates over a single element.
  Since:
    August 08, 2021
  Author:
    Rammi

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SingletonIterator(T element)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `hasNext()`
    `T` | `next()`

    - ### 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

    - #### SingletonIterator

          public SingletonIterator(T element)

      Constructor.
      Parameters:
        `element` - single element in this iterator

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