java.lang.Object | +--org.apache.commons.collections.iterators.EnumerationIteratorAll Implemented Interfaces:
Constructs a new EnumerationIterator that will not function until #setEnumeration(Enumeration) is called. |
EnumerationIterator(final Enumeration enumeration) Constructs a new EnumerationIterator that provides an iterator view of the given enumeration. |
EnumerationIterator(final Enumeration enum, final Collection collection) Constructs a new EnumerationIterator that will remove elements from the specified collection. |
Enumeration | Returns the underlying enumeration. |
boolean | hasNext() Returns true if the underlying enumeration has more elements. |
Object | next() Returns the next object from the enumeration. |
void | remove() Removes the last retrieved element if a collection is attached. |
void | setEnumeration(final Enumeration enumeration) Sets the underlying enumeration. |
public EnumerationIterator()
EnumerationIterator
that will not
function until setEnumeration(Enumeration) is called.
public EnumerationIterator(final Enumeration enum, final Collection collection)
EnumerationIterator
that will remove
elements from the specified collection.
public EnumerationIterator(final Enumeration enumeration)
EnumerationIterator
that provides
an iterator view of the given enumeration.
public Enumeration getEnumeration()
public boolean hasNext()
- if the underlying enumeration is nullpublic Object next()
- if the enumeration is nullpublic void remove()
Collection
is known.
If so, the first occurrence of the last returned object from this
iterator will be removed from the collection.
- next() not called.
- if no associated collectionpublic void setEnumeration(final Enumeration enumeration)