|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.collections.iterators.EnumerationIterator<E>
public class EnumerationIterator<E>
Adapter to make Enumeration
instances appear
to be Iterator
instances.
Constructor Summary | |
---|---|
EnumerationIterator()
Constructs a new EnumerationIterator that will not
function until setEnumeration(Enumeration) is called. |
|
EnumerationIterator(Enumeration<E> enumeration)
Constructs a new EnumerationIterator that provides
an iterator view of the given enumeration. |
|
EnumerationIterator(Enumeration<E> enumeration,
Collection<E> collection)
Constructs a new EnumerationIterator that will remove
elements from the specified collection. |
Method Summary | |
---|---|
Enumeration<E> |
getEnumeration()
Returns the underlying enumeration. |
boolean |
hasNext()
Returns true if the underlying enumeration has more elements. |
E |
next()
Returns the next object from the enumeration. |
void |
remove()
Removes the last retrieved element if a collection is attached. |
void |
setEnumeration(Enumeration<E> enumeration)
Sets the underlying enumeration. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EnumerationIterator()
EnumerationIterator
that will not
function until setEnumeration(Enumeration)
is called.
public EnumerationIterator(Enumeration<E> enumeration)
EnumerationIterator
that provides
an iterator view of the given enumeration.
enumeration
- the enumeration to usepublic EnumerationIterator(Enumeration<E> enumeration, Collection<E> collection)
EnumerationIterator
that will remove
elements from the specified collection.
enumeration
- the enumeration to usecollection
- the collection to remove elements formMethod Detail |
---|
public boolean hasNext()
hasNext
in interface Iterator<E>
NullPointerException
- if the underlying enumeration is nullpublic E next()
next
in interface Iterator<E>
NullPointerException
- 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.
remove
in interface Iterator<E>
IllegalStateException
- next()
not called.
UnsupportedOperationException
- if no associated collectionpublic Enumeration<E> getEnumeration()
public void setEnumeration(Enumeration<E> enumeration)
enumeration
- the new underlying enumeration
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |