Class EnumerationIterator

java.lang.Object
de.intarsys.tools.collection.EnumerationIterator
All Implemented Interfaces:
Iterator

public class EnumerationIterator extends Object implements Iterator
Wraps an enumeration into an Iterator API.
  • Constructor Details

    • EnumerationIterator

      public EnumerationIterator(Enumeration e)
      Create an Iterator over an enumeration.
      Parameters:
      e - The enumeration to be iterated.
  • Method Details

    • getEnumeration

      protected Enumeration getEnumeration()
    • hasNext

      public boolean hasNext()
      Return true if underlying enumeration still has elements.
      Specified by:
      hasNext in interface Iterator
      Returns:
      true if underlying enumeration still has elements.
    • next

      public Object next()
      Return the next element from the underlying enumeration.
      Specified by:
      next in interface Iterator
      Returns:
      the next element from the underlying enumeration.
      Throws:
      NoSuchElementException
    • remove

      public void remove()
      Specified by:
      remove in interface Iterator