to top
Android APIs
Since: API Level 1
public interface

Enumeration

java.util.Enumeration<E>
Known Indirect Subclasses

Class Overview

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

public abstract boolean hasMoreElements ()

Since: API Level 1

Returns whether this Enumeration has more elements.

Returns
  • true if there are more elements, false otherwise.
See Also

public abstract E nextElement ()

Since: API Level 1

Returns the next element in this Enumeration.

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