Package com.day.util

Class IteratorEnumeration

  • All Implemented Interfaces:
    Enumeration

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

      • IteratorEnumeration

        public IteratorEnumeration​(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 Enumeration
        Returns:
        true if and only if this enumeration object contains at least one more element to provide; false otherwise.
      • nextElement

        public 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 Enumeration
        Returns:
        the next element of this enumeration.