[all packages] [package gj.util] [class hierarchy] [index]

public interface gj.util.Enumeration<A>

(source file: util/Enumeration.java)
java.lang.Object
   |
   +----gj.util.Enumeration<A>

The pure class interface.
public interface Enumeration<A>
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

Methods

O hasMoreElements()
Returns true if the enumeration contains more elements; false if its empty.
O nextElement()
Returns the next element of the enumeration

Methods

O hasMoreElements
public abstract boolean hasMoreElements();
Returns true if the enumeration contains more elements; false if its empty.

O nextElement

public abstract A nextElement();
Returns the next element of the enumeration. Calls to this method will enumerate successive elements.

Throws:
NoSuchElementException -If no more elements exist.


[all packages] [package gj.util] [class hierarchy] [index]
gj.util.Enumeration.html