java.lang.Object
org.bzdev.util.IteratorEnumeration<E>
- All Implemented Interfaces:
Enumeration<E>
Class for an Enumeration whose implementation uses an Iterator.
The Iterator class was introduced in Java 1.2 as an improvement
over the Enumeration class. Unfortunately, some APIs require
an Enumeration and others require an Iterator. This class provides
a bridge between the two APIs.
-
Constructor Details
-
IteratorEnumeration
Constructor. The Iterator passed to the constructor will be modified as this class is used.- Parameters:
iterator
- the iterator
-
-
Method Details
-
nextElement
- Specified by:
nextElement
in interfaceEnumeration<E>
- Throws:
NoSuchElementException
-
hasMoreElements
public boolean hasMoreElements()- Specified by:
hasMoreElements
in interfaceEnumeration<E>
-