org.apache.commons.collections.iterators
public class IteratorEnumeration extends java.lang.Object implements java.util.Enumeration
Iterator
instance appear to be an Enumeration
instancesConstructor and Description |
---|
IteratorEnumeration()
Constructs a new
IteratorEnumeration that will not
function until setIterator is
invoked. |
IteratorEnumeration(java.util.Iterator iterator)
Constructs a new
IteratorEnumeration that will use
the given iterator. |
Modifier and Type | Method and Description |
---|---|
java.util.Iterator |
getIterator()
Returns the underlying iterator.
|
boolean |
hasMoreElements()
Returns true if the underlying iterator has more elements.
|
java.lang.Object |
nextElement()
Returns the next element from the underlying iterator.
|
void |
setIterator(java.util.Iterator iterator)
Sets the underlying iterator.
|
public IteratorEnumeration()
IteratorEnumeration
that will not
function until setIterator
is
invoked.public IteratorEnumeration(java.util.Iterator iterator)
IteratorEnumeration
that will use
the given iterator.iterator
- the iterator to usepublic java.util.Iterator getIterator()
public boolean hasMoreElements()
hasMoreElements
in interface java.util.Enumeration
public java.lang.Object nextElement()
nextElement
in interface java.util.Enumeration
NoSuchElementException
- if the underlying iterator has no
more elementspublic void setIterator(java.util.Iterator iterator)
iterator
- the new underlying iteratorCopyright © 2001-2004 Apache Software Foundation. Documenation generated March 13 2014.