|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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()); }
Vector
,
Hashtable
Method Summary | |
boolean |
hasMoreElements()
Returns true if the enumeration contains more elements; false if its empty. |
Object |
nextElement()
Returns the next element of the enumeration. |
Method Detail |
public boolean hasMoreElements()
public Object nextElement()
NoSuchElementException
- If no more elements exist.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |