public class IteratorEnumeration<E>
extends java.lang.Object
implements java.util.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(java.util.Iterator<? extends E> iterator)
Constructs a new
IteratorEnumeration that will use the given
iterator. |
Modifier and Type | Method and Description |
---|---|
java.util.Iterator<? extends E> |
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(java.util.Iterator<? extends E> iterator)
Sets the underlying iterator.
|
public IteratorEnumeration()
IteratorEnumeration
that will not function
until setIterator
is invoked.public IteratorEnumeration(java.util.Iterator<? extends E> iterator)
IteratorEnumeration
that will use the given
iterator.iterator
- the iterator to usepublic boolean hasMoreElements()
hasMoreElements
in interface java.util.Enumeration<E>
public E nextElement()
nextElement
in interface java.util.Enumeration<E>
java.util.NoSuchElementException
- if the underlying iterator has
no more elementspublic java.util.Iterator<? extends E> getIterator()
public void setIterator(java.util.Iterator<? extends E> iterator)
iterator
- the new underlying iteratorCopyright © 2010 - 2020 Adobe. All Rights Reserved