Package org.jppf.utils.collections
Class IteratorEnumeration<T>
java.lang.Object
org.jppf.utils.collections.IteratorEnumeration<T>
- Type Parameters:
T- the type of the enumerated objects.
- All Implemented Interfaces:
Enumeration<T>
Wraps an Iterator as an Enumeration
-
Constructor Summary
ConstructorsConstructorDescriptionIteratorEnumeration(Iterator<T> iterator) Initialize this enumeration with the specified 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Enumeration
asIterator
-
Constructor Details
-
IteratorEnumeration
Initialize this enumeration with the specified iterator.- Parameters:
iterator- the iterator to wrap as an enumeration.
-
-
Method Details
-
hasMoreElements
public boolean hasMoreElements()Tests if this enumeration contains more elements.- Specified by:
hasMoreElementsin interfaceEnumeration<T>- Returns:
- true if and only if this enumeration object contains at least one more element to provide, false otherwise.
- See Also:
-
nextElement
Returns the next element of this enumeration if this enumeration object has at least one more element to provide.- Specified by:
nextElementin interfaceEnumeration<T>- Returns:
- the next element of this enumeration.
- Throws:
NoSuchElementException- if no more elements exist.- See Also:
-