Skip to content

Most visited

Recently visited

navigation
Added in API level 1

Enumeration

public interface Enumeration

java.util.Enumeration<E>
Known Indirect Subclasses


A legacy iteration interface.

New code should use Iterator instead. Iterator replaces the enumeration interface and adds a way to remove elements from a collection.

If you have an Enumeration and want a Collection, you can use list(Enumeration) to get a List.

If you need an Enumeration for a legacy API and have a Collection, you can use enumeration(Collection).

See also:

Summary

Public methods

abstract boolean hasMoreElements()

Returns whether this Enumeration has more elements.

abstract E nextElement()

Returns the next element in this Enumeration.

Public methods

hasMoreElements

Added in API level 1
boolean hasMoreElements ()

Returns whether this Enumeration has more elements.

Returns
boolean true if there are more elements, false otherwise.

See also:

nextElement

Added in API level 1
E nextElement ()

Returns the next element in this Enumeration.

Returns
E the next element..
Throws
NoSuchElementException if there are no more elements.

See also:

This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.