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: 646777 $ $Date: 2008-04-10 13:33:15 +0100 (Thu, 10 Apr 2008) $
| 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