Class SingletonIterator<E>

  • Type Parameters:
    E - the type of elements returned by this iterator
    All Implemented Interfaces:
    java.util.Iterator<E>

    public class SingletonIterator<E>
    extends ReadOnlyIterator<E>
    Singleton Iterator
    Since:
    1.0.0
    Author:
    Mercy
    • Constructor Summary

      Constructors 
      Constructor Description
      SingletonIterator​(E element)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void forEachRemaining​(java.util.function.Consumer<? super E> action)  
      boolean hasNext()  
      E next()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SingletonIterator

        public SingletonIterator​(E element)
    • Method Detail

      • hasNext

        public boolean hasNext()
      • next

        public E next()
      • forEachRemaining

        public void forEachRemaining​(java.util.function.Consumer<? super E> action)