Class EnumerationIterator
java.lang.Object
org.apache.commons.collections.iterators.EnumerationIterator
- All Implemented Interfaces:
Iterator
Deprecated.
Apache Commons Collections version 3.x is being deprecated from AEMaaCS. The upgraded version 4.4 of Commons Collections is already included as replacement. Customers are advised to upgrade to this version of the library. Please note: the package name was changed to org.apache.commons.collections4. Further note that there are AEM APIs currently exposing the old collections classes; these will be updated in upcoming releases.
Adapter to make
Enumeration instances appear
to be Iterator instances.- Since:
- Commons Collections 1.0
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Constructs a newEnumerationIteratorthat will not function untilsetEnumeration(Enumeration)is called.EnumerationIterator(Enumeration enumeration) Deprecated.Constructs a newEnumerationIteratorthat provides an iterator view of the given enumeration.EnumerationIterator(Enumeration enumeration, Collection collection) Deprecated.Constructs a newEnumerationIteratorthat will remove elements from the specified collection. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Returns the underlying enumeration.booleanhasNext()Deprecated.Returns true if the underlying enumeration has more elements.next()Deprecated.Returns the next object from the enumeration.voidremove()Deprecated.Removes the last retrieved element if a collection is attached.voidsetEnumeration(Enumeration enumeration) Deprecated.Sets the underlying enumeration.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
EnumerationIterator
public EnumerationIterator()Deprecated.Constructs a newEnumerationIteratorthat will not function untilsetEnumeration(Enumeration)is called. -
EnumerationIterator
Deprecated.Constructs a newEnumerationIteratorthat provides an iterator view of the given enumeration.- Parameters:
enumeration- the enumeration to use
-
EnumerationIterator
Deprecated.Constructs a newEnumerationIteratorthat will remove elements from the specified collection.- Parameters:
enumeration- the enumeration to usecollection- the collection to remove elements form
-
-
Method Details
-
hasNext
public boolean hasNext()Deprecated.Returns true if the underlying enumeration has more elements.- Specified by:
hasNextin interfaceIterator- Returns:
- true if the underlying enumeration has more elements
- Throws:
NullPointerException- if the underlying enumeration is null
-
next
Deprecated.Returns the next object from the enumeration.- Specified by:
nextin interfaceIterator- Returns:
- the next object from the enumeration
- Throws:
NullPointerException- if the enumeration is null
-
remove
public void remove()Deprecated.Removes the last retrieved element if a collection is attached.Functions if an associated
Collectionis known. If so, the first occurrence of the last returned object from this iterator will be removed from the collection.- Specified by:
removein interfaceIterator- Throws:
IllegalStateException-next()not called.UnsupportedOperationException- if no associated collection
-
getEnumeration
Deprecated.Returns the underlying enumeration.- Returns:
- the underlying enumeration
-
setEnumeration
Deprecated.Sets the underlying enumeration.- Parameters:
enumeration- the new underlying enumeration
-