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 [joe at eireneh dot com]
See Also:
for license details.
The copyright to this program is held by it's authors.

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()
          Returns true if the iteration has more elements
 E nextElement()
          Returns the next element in the interation
 
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

Method Detail

hasMoreElements

public boolean hasMoreElements()
Returns true if the iteration has more elements

Specified by:
hasMoreElements in interface Enumeration<E>

nextElement

public E nextElement()
              throws NoSuchElementException
Returns the next element in the interation

Specified by:
nextElement in interface Enumeration<E>
Throws:
NoSuchElementException

Copyright ? 2003-2011