public class IteratorEnumeration<E> extends Objectimplements Enumeration <E>
Iterator instance appear to be an
Enumeration instance.
| Constructor and Description |
|---|
IteratorEnumeration()
Constructs a new
IteratorEnumeration that will not function until
setIterator is invoked.
|
IteratorEnumeration(Iterator
Constructs a new
IteratorEnumeration that will use the given iterator.
|
| Modifier and Type | Method and Description |
|---|---|
Iterator |
getIterator()
Returns the underlying iterator.
|
boolean |
hasMoreElements()
Returns true if the underlying iterator has more elements.
|
E |
nextElement()
Returns the next element from the underlying iterator.
|
void |
setIterator(Iterator
Sets the underlying iterator.
|
public IteratorEnumeration()
IteratorEnumeration that will not function until
setIterator is invoked.
public boolean hasMoreElements()
hasMoreElements in interface
Enumeration<E>
public E nextElement()
nextElement in interface
Enumeration<E>
NoSuchElementException - if the underlying iterator has no more elements
public Iterator<? extends E> getIterator()