intarsys runtime library

de.intarsys.tools.collection
Class EnumerationIterator<T>

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

public class EnumerationIterator<T>
extends Object
implements Iterator<T>

Wraps an enumeration into an Iterator API.


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

Constructor Detail

EnumerationIterator

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

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

hasNext

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

Specified by:
hasNext in interface Iterator<T>
Returns:
true if underlying enumeration still has elements.

next

public T next()
Return the next element from the underlying enumeration.

Specified by:
next in interface Iterator<T>
Returns:
the next element from the underlying enumeration.
Throws:
NoSuchElementException

remove

public void remove()
Specified by:
remove in interface Iterator<T>

intarsys runtime library

Copyright © 2012 intarsys consulting GmbH. All Rights Reserved.