Class IteratorEnumeration
- java.lang.Object
-
- org.apache.commons.collections.iterators.IteratorEnumeration
-
- All Implemented Interfaces:
Enumeration
@Deprecated(since="2021-04-30") public class IteratorEnumeration extends Object implements Enumeration
Deprecated.Commons Collections 3 is in maintenance mode. Commons Collections 4 should be used instead.Adapter to make anIteratorinstance appear to be anEnumerationinstance.- Since:
- Commons Collections 1.0
-
-
Constructor Summary
Constructors Constructor Description IteratorEnumeration()Deprecated.Constructs a newIteratorEnumerationthat will not function untilsetIteratoris invoked.IteratorEnumeration(Iterator iterator)Deprecated.Constructs a newIteratorEnumerationthat will use the given iterator.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description IteratorgetIterator()Deprecated.Returns the underlying iterator.booleanhasMoreElements()Deprecated.Returns true if the underlying iterator has more elements.ObjectnextElement()Deprecated.Returns the next element from the underlying iterator.voidsetIterator(Iterator iterator)Deprecated.Sets the underlying iterator.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Enumeration
asIterator
-
-
-
-
Constructor Detail
-
IteratorEnumeration
public IteratorEnumeration()
Deprecated.Constructs a newIteratorEnumerationthat will not function untilsetIteratoris invoked.
-
IteratorEnumeration
public IteratorEnumeration(Iterator iterator)
Deprecated.Constructs a newIteratorEnumerationthat will use the given iterator.- Parameters:
iterator- the iterator to use
-
-
Method Detail
-
hasMoreElements
public boolean hasMoreElements()
Deprecated.Returns true if the underlying iterator has more elements.- Specified by:
hasMoreElementsin interfaceEnumeration- Returns:
- true if the underlying iterator has more elements
-
nextElement
public Object nextElement()
Deprecated.Returns the next element from the underlying iterator.- Specified by:
nextElementin interfaceEnumeration- Returns:
- the next element from the underlying iterator.
- Throws:
NoSuchElementException- if the underlying iterator has no more elements
-
getIterator
public Iterator getIterator()
Deprecated.Returns the underlying iterator.- Returns:
- the underlying iterator
-
setIterator
public void setIterator(Iterator iterator)
Deprecated.Sets the underlying iterator.- Parameters:
iterator- the new underlying iterator
-
-