to top
Android APIs
Added in 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 ()

Added in 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 ()

Added in API level 1

Returns the next element in this Enumeration.

Returns
  • the next element..
Throws
NoSuchElementException if there are no more elements.
No examples for this method.
Frequently called with: [Clear]
Portions of this page are reproduced from work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. The original page is available here.