Interface java.util.Enumeration
All Packages This Package Previous Next
Interface java.util.Enumeration
-
public interface
Enumeration
-
extends Object
The Enumeration interface specifies a set of methods that may be used
to enumerate, or count through, a set of values. The enumeration is
consumed by use; its values may only be counted once.
For example, to print all elements of a Vector v:
for (Enumeration e = v.elements() ; e.hasMoreElements() ;) {
System.out.println(e.nextElement());
}
-
See Also:
-
Vector,
Hashtable
-
Version:
-
1.6, 31 Jan 1995
-
Author:
-
Lee Boynton
-
hasMoreElements()
-
Returns true if the there are more elements in the
enumeration.
-
nextElement()
-
Returns the next element of the enumeration.
hasMoreElements
public abstract boolean hasMoreElements()
-
Returns true if the there are more elements in the
enumeration.
nextElement
public abstract Object nextElement()
-
Returns the next element of the enumeration. Calls to
nextElement() will enumerate successive element.
-
Throws: NoSuchElementException
-
No more elements
All Packages This Package Previous Next