Class IteratorEnum<E>

  • Type Parameters:
    E - type of elements enumerated
    All Implemented Interfaces:
    java.util.Enumeration<E>

    public class IteratorEnum<E>
    extends java.lang.Object
    implements java.util.Enumeration<E>
    An implementation of Enumeration that uses an Iterator.
    • Constructor Summary

      Constructors 
      Constructor Description
      IteratorEnum​(java.util.Iterator<E> it)
      Create an enumeration based upon the supplied iterator.
    • Method Summary

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

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

        asIterator
    • Constructor Detail

      • IteratorEnum

        public IteratorEnum​(java.util.Iterator<E> it)
        Create an enumeration based upon the supplied iterator. The iterator is not reset.
        Parameters:
        it - iterator to use for enumeration
    • Method Detail

      • hasMoreElements

        public boolean hasMoreElements()
        Specified by:
        hasMoreElements in interface java.util.Enumeration<E>
      • nextElement

        public E nextElement()
        Specified by:
        nextElement in interface java.util.Enumeration<E>