Package com.Ostermiller.util
Class IteratorEnumeration<ElementType>
java.lang.Object
com.Ostermiller.util.IteratorEnumeration<ElementType>
- Type Parameters:
ElementType- Type of element being enumerated
- All Implemented Interfaces:
Enumeration<ElementType>
Converts an iterator to an enumerator.
More information about this class is available from ostermiller.org.
- Since:
- ostermillerutils 1.03.00
- Author:
- Stephen Ostermiller https://ostermiller.org/contact.pl?regarding=Java+Utilities
-
Constructor Summary
ConstructorsConstructorDescriptionIteratorEnumeration(Iterator<ElementType> iterator) Create an Enumeration from an Iterator. -
Method Summary
Modifier and TypeMethodDescriptionbooleanTests if this enumeration contains more elements.Returns the next element of this enumeration if this enumeration object has at least one more element to provide.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Enumeration
asIterator
-
Constructor Details
-
IteratorEnumeration
Create an Enumeration from an Iterator.- Parameters:
iterator- Iterator to convert to an enumeration.- Since:
- ostermillerutils 1.03.00
-
-
Method Details
-
hasMoreElements
public boolean hasMoreElements()Tests if this enumeration contains more elements.- Specified by:
hasMoreElementsin interfaceEnumeration<ElementType>- Returns:
- true if and only if this enumeration object contains at least one more element to provide; false otherwise.
- Since:
- ostermillerutils 1.03.00
-
nextElement
Returns the next element of this enumeration if this enumeration object has at least one more element to provide.- Specified by:
nextElementin interfaceEnumeration<ElementType>- Returns:
- the next element of this enumeration.
- Throws:
NoSuchElementException- if no more elements exist.- Since:
- ostermillerutils 1.03.00
-