Package com.day.util

Class IteratorEnumeration

  • All Implemented Interfaces:
    java.util.Enumeration

    public class IteratorEnumeration
    extends java.lang.Object
    implements java.util.Enumeration
    An IteratorEnumeration provides a one-to-one mapping from the pre Java 2 Enumeration to the Java 2 Iterator
    Since:
    antbear
    • Constructor Summary

      Constructors 
      Constructor Description
      IteratorEnumeration​(java.util.Iterator iter)
      Create a new IteratorEnumeration given an Iterator that backs up the Enumeration
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean hasMoreElements()
      Tests if this enumeration contains more elements.
      java.lang.Object nextElement()
      Returns the next element of this enumeration if this enumeration object has at least one more element to provide.
      • Methods inherited from class java.lang.Object

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

        asIterator
    • Constructor Detail

      • IteratorEnumeration

        public IteratorEnumeration​(java.util.Iterator iter)
        Create a new IteratorEnumeration given an Iterator that backs up the Enumeration
        Parameters:
        iter - the iterator
    • Method Detail

      • hasMoreElements

        public boolean hasMoreElements()
        Tests if this enumeration contains more elements.
        Specified by:
        hasMoreElements in interface java.util.Enumeration
        Returns:
        true if and only if this enumeration object contains at least one more element to provide; false otherwise.
      • nextElement

        public java.lang.Object nextElement()
        Returns the next element of this enumeration if this enumeration object has at least one more element to provide.
        Specified by:
        nextElement in interface java.util.Enumeration
        Returns:
        the next element of this enumeration.