org.apache.commons.collections.iterators
public class IteratorEnumeration extends Object implements Enumeration
Iterator Iterator
instance appear to be
an Enumeration Enumeration
instance.
Since: Commons Collections 1.0
Version: $Revision: 155406 $ $Date: 2005-02-26 12:55:26 +0000 (Sat, 26 Feb 2005) $
Constructor Summary | |
---|---|
IteratorEnumeration()
Constructs a new IteratorEnumeration that will not
function until setIterator is
invoked. | |
IteratorEnumeration(Iterator iterator)
Constructs a new IteratorEnumeration that will use
the given iterator.
|
Method Summary | |
---|---|
Iterator | getIterator()
Returns the underlying iterator.
|
boolean | hasMoreElements()
Returns true if the underlying iterator has more elements.
|
Object | nextElement()
Returns the next element from the underlying iterator.
|
void | setIterator(Iterator iterator)
Sets the underlying iterator.
|
IteratorEnumeration
that will not
function until setIterator
is
invoked.IteratorEnumeration
that will use
the given iterator.
Parameters: iterator the iterator to use
Returns: the underlying iterator
Returns: true if the underlying iterator has more elements
Returns: the next element from the underlying iterator.
Throws: java.util.NoSuchElementException if the underlying iterator has no more elements
Parameters: iterator the new underlying iterator