Class SingletonIterator<T>

    • Constructor Detail

      • SingletonIterator

        public SingletonIterator​(T element)
        Constructor
        Parameters:
        element - the single value to be returned
    • Method Detail

      • hasNext

        public boolean hasNext()
        Can return a single value
        Specified by:
        hasNext in interface java.util.Iterator<T>
        Overrides:
        hasNext in class NiceIterator<T>
      • next

        public T next()
        Return the value
        Specified by:
        next in interface java.util.Iterator<T>
        Overrides:
        next in class NiceIterator<T>