Class IteratorEnumeration<E>
java.lang.Object
org.apache.commons.collections4.iterators.IteratorEnumeration<E>
- Type Parameters:
- E- the type of elements returned by this iterator.
- All Implemented Interfaces:
- Enumeration<E>
Adapter to make an 
Iterator instance appear to be an
 Enumeration instance.- Since:
- 1.0
- 
Constructor SummaryConstructorsConstructorDescriptionConstructs a newIteratorEnumerationthat will not function untilsetIteratoris invoked.IteratorEnumeration(Iterator<? extends E> iterator) Constructs a newIteratorEnumerationthat will use the given iterator.
- 
Method SummaryModifier and TypeMethodDescriptionGets the underlying iterator.booleanReturns true if the underlying iterator has more elements.Returns the next element from the underlying iterator.voidsetIterator(Iterator<? extends E> iterator) Sets the underlying iterator.
- 
Constructor Details- 
IteratorEnumerationpublic IteratorEnumeration()Constructs a newIteratorEnumerationthat will not function untilsetIteratoris invoked.
- 
IteratorEnumerationConstructs a newIteratorEnumerationthat will use the given iterator.- Parameters:
- iterator- the iterator to use
 
 
- 
- 
Method Details- 
getIteratorGets the underlying iterator.- Returns:
- the underlying iterator
 
- 
hasMoreElementsReturns true if the underlying iterator has more elements.- Specified by:
- hasMoreElementsin interface- Enumeration<E>
- Returns:
- true if the underlying iterator has more elements
 
- 
nextElementReturns the next element from the underlying iterator.- Specified by:
- nextElementin interface- Enumeration<E>
- Returns:
- the next element from the underlying iterator.
- Throws:
- NoSuchElementException- if the underlying iterator has no more elements
 
- 
setIteratorSets the underlying iterator.- Parameters:
- iterator- the new underlying iterator
 
 
-