Class EnumerationIterator<T>

  • All Implemented Interfaces:
    Iterable<T>, Iterator<T>

    public class EnumerationIterator<T>extends Objectimplements Iterator<T>, Iterable<T>

    The EnumerationIterator class is an adapter that makes a java.util.Enumeration object look and behave like a java.util.Iterator objects. The EnumerationIterator class implements the Iterator interface and wraps an existing Enumeration object. This class is the conceptual opposite of the Collections.enumeration() method in the java.util package.

    You can also use an instance of this class to wrap an Enumeration for use in a JDK 1.5-style for each loop. For instance:

     Vector v = ... for (String s : new EnumerationIterator (v.elements()))     ... 
    See Also:
    Iterator, Enumeration
    • Constructor Summary

      Constructor and Description
      EnumerationIterator(Enumeration<T> enumeration)
      Allocate a new EnumerationIterator object that will forward its calls to the specified Enumeration.

SCaVis 2.2 © jWork.ORG