Package java.util
Interface Enumeration<E>
-
- All Known Implementing Classes:
StringTokenizer,StringTokenizer
public interface Enumeration<E>A legacy iteration interface.New code should use
Iteratorinstead.Iteratorreplaces the enumeration interface and adds a way to remove elements from a collection.If you have an
Enumerationand want aCollection, you can useCollections.list(java.util.Enumeration<T>)to get aList.If you need an
Enumerationfor a legacy API and have aCollection, you can useCollections.enumeration(java.util.Collection<T>).- See Also:
Iterator
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanhasMoreElements()Returns whether thisEnumerationhas more elements.EnextElement()Returns the next element in thisEnumeration.
-
-
-
Method Detail
-
hasMoreElements
boolean hasMoreElements()
Returns whether thisEnumerationhas more elements.- Returns:
trueif there are more elements,falseotherwise.- See Also:
nextElement()
-
nextElement
E nextElement()
Returns the next element in thisEnumeration.- Returns:
- the next element..
- Throws:
NoSuchElementException- if there are no more elements.- See Also:
hasMoreElements()
-
-