Class SingletonIterator<E>

  • All Implemented Interfaces:
    java.util.Iterator<E>

    public final class SingletonIterator<E>
    extends BaseIterator<E>
    An iterator to iterate a single value.
    • Constructor Summary

      Constructors 
      Constructor Description
      SingletonIterator​(E value)
      Creates an Iterator that iterates (only) the given value.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean hasNext()  
      E next()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Iterator

        forEachRemaining
    • Constructor Detail

      • SingletonIterator

        public SingletonIterator​(E value)
        Creates an Iterator that iterates (only) the given value.
        Parameters:
        value - The sole value to iterate.
    • Method Detail

      • hasNext

        public boolean hasNext()
      • next

        public E next()