de.intarsys.tools.collection
Class EnumerationIterator

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

public class EnumerationIterator
extends java.lang.Object
implements java.util.Iterator

Wraps an enumeration into an Iterator API.


Constructor Summary
EnumerationIterator(java.util.Enumeration e)
          Create an Iterator over an enumeration.
 
Method Summary
protected  java.util.Enumeration getEnumeration()
           
 boolean hasNext()
          Return true if underlying enumeration still has elements.
 java.lang.Object next()
          Return the next element from the underlying enumeration.
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnumerationIterator

public EnumerationIterator(java.util.Enumeration e)
Create an Iterator over an enumeration.

Parameters:
e - The enumeration to be iterated.
Method Detail

getEnumeration

protected java.util.Enumeration getEnumeration()

hasNext

public boolean hasNext()
Return true if underlying enumeration still has elements.

Specified by:
hasNext in interface java.util.Iterator
Returns:
true if underlying enumeration still has elements.

next

public java.lang.Object next()
Return the next element from the underlying enumeration.

Specified by:
next in interface java.util.Iterator
Returns:
the next element from the underlying enumeration.
Throws:
java.util.NoSuchElementException

remove

public void remove()
Specified by:
remove in interface java.util.Iterator