Class IteratorEnumeration<E>

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

    public class IteratorEnumeration<E>
    extends java.lang.Object
    implements java.util.Enumeration<E>
    A class implementing an enumeration through an iterator.
    • Constructor Summary

      Constructors 
      Constructor Description
      IteratorEnumeration​(java.util.Iterator<E> iterator)
      Creates a new IteratorEnumeration providing an enumeration interface to the specified iterator.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean hasMoreElements()
      DOCUMENT-ME
      E nextElement()
      DOCUMENT-ME
      • 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

      • IteratorEnumeration

        public IteratorEnumeration​(java.util.Iterator<E> iterator)
        Creates a new IteratorEnumeration providing an enumeration interface to the specified iterator.
        Parameters:
        iterator - the Iterator to enumerate. If iterator is null the hasMoreElements() method always returns false and the nextElement() method always throws an NoSuchElementException.
    • Method Detail

      • hasMoreElements

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

        public E nextElement()
                      throws java.util.NoSuchElementException
        DOCUMENT-ME
        Specified by:
        nextElement in interface java.util.Enumeration<E>
        Throws:
        java.util.NoSuchElementException - DOCUMENT-ME