| |
|
| java.lang.Object org.apache.commons.collections.iterators.EnumerationIterator
EnumerationIterator | public class EnumerationIterator implements Iterator(Code) | | Adapter to make
Enumeration Enumeration instances appear
to be
Iterator Iterator instances.
since: Commons Collections 1.0 version: $Revision: 155406 $ $Date: 2005-02-26 12:55:26 +0000 (Sat, 26 Feb 2005) $ author: James Strachan author: Daniel Rall |
Method Summary | |
public Enumeration | getEnumeration() Returns the underlying enumeration. | public boolean | hasNext() Returns true if the underlying enumeration has more elements. | public Object | next() Returns the next object from the enumeration. | public void | remove() Removes the last retrieved element if a collection is attached. | public void | setEnumeration(Enumeration enumeration) Sets the underlying enumeration. |
EnumerationIterator | public EnumerationIterator(Enumeration enumeration)(Code) | | Constructs a new EnumerationIterator that provides
an iterator view of the given enumeration.
Parameters: enumeration - the enumeration to use |
EnumerationIterator | public EnumerationIterator(Enumeration enumeration, Collection collection)(Code) | | Constructs a new EnumerationIterator that will remove
elements from the specified collection.
Parameters: enumeration - the enumeration to use Parameters: collection - the collection to remove elements form |
getEnumeration | public Enumeration getEnumeration()(Code) | | Returns the underlying enumeration.
the underlying enumeration |
hasNext | public boolean hasNext()(Code) | | Returns true if the underlying enumeration has more elements.
true if the underlying enumeration has more elements throws: NullPointerException - if the underlying enumeration is null |
next | public Object next()(Code) | | Returns the next object from the enumeration.
the next object from the enumeration throws: NullPointerException - if the enumeration is null |
remove | public void remove()(Code) | | Removes the last retrieved element if a collection is attached.
Functions if an associated Collection is known.
If so, the first occurrence of the last returned object from this
iterator will be removed from the collection.
exception: IllegalStateException - next() not called. exception: UnsupportedOperationException - if no associated collection |
setEnumeration | public void setEnumeration(Enumeration enumeration)(Code) | | Sets the underlying enumeration.
Parameters: enumeration - the new underlying enumeration |
|
|
|