org.crosswire.common.util
Class IteratorEnumeration<E>

java.lang.Object
  extended by org.crosswire.common.util.IteratorEnumeration<E>
Type Parameters:
E - The type of the elements returned by this iterator
All Implemented Interfaces:
Enumeration<E>

public final class IteratorEnumeration<E>
extends Object
implements Enumeration<E>

Convert an Iterator into a Enumeration.

The only real difference between the 2 is the naming and that Enumeration does not have the delete method.

Author:
Joe Walker
See Also:
The GNU Lesser General Public License for details.

Field Summary
private  Iterator<E> it
          The Iterator that we are proxying to
 
Constructor Summary
IteratorEnumeration(Iterator<E> it)
          Create an Enumeration that proxies to an Iterator.
 
Method Summary
 boolean hasMoreElements()
           
 E nextElement()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

it

private Iterator<E> it
The Iterator that we are proxying to

Constructor Detail

IteratorEnumeration

public IteratorEnumeration(Iterator<E> it)
Create an Enumeration that proxies to an Iterator.

Parameters:
it - the iterator to wrap.
Method Detail

hasMoreElements

public boolean hasMoreElements()
Specified by:
hasMoreElements in interface Enumeration<E>

nextElement

public E nextElement()
              throws NoSuchElementException
Specified by:
nextElement in interface Enumeration<E>
Throws:
NoSuchElementException

Copyright ยจ 2003-2015