Class SingletonIterator<T>

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

    public class SingletonIterator<T>
    extends java.lang.Object
    implements java.util.Iterator<T>
    Simple read-only iterator that iterators over one specific item, passed in as constructor argument.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean _done  
      private T _value  
    • Constructor Summary

      Constructors 
      Constructor Description
      SingletonIterator​(T value)
      Deprecated.
    • Field Detail

      • _value

        private final T _value
      • _done

        private boolean _done
    • Constructor Detail

      • SingletonIterator

        @Deprecated
        public SingletonIterator​(T value)
        Deprecated.
    • 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>
      • remove

        public void remove()
        Specified by:
        remove in interface java.util.Iterator<T>