EnumerationE


Enumeration<E> java.util

Java 1.0

This interface defines the methods necessary to enumerate, or iterate, through a set of values, such as the set of values contained in a hashtable. This interface is superseded in Java 1.2 by the Iterator inteface. In Java 5.0 this interface has been made generic and defines the type variable E to represent the type of the objects being enumerated.

An Enumeration is usually not instantiated directly, but instead is created by the object that is to have its values enumerated. A number of classes, such as Vector and Hashtable , have methods that return Enumeration objects.

To use an Enumeration object, you use its two methods in a loop. hasMoreElements( ) returns TRue if there are more values to be enumerated and can determine whether a loop should continue. Within a loop, a call to nextElement( ) returns a value from the enumeration. An Enumeration makes no guarantees about the order in which the values are returned. The values in an Enumeration can be iterated through only once; there is no way to reset it to the beginning.

 public interface  Enumeration<E>  {  // Public Instance Methods  boolean  hasMoreElements  ( );        E  nextElement  ( );   } 

Implementations

StringTokenizer

Passed To

java.io.SequenceInputStream.SequenceInputStream( ) , Collections.list( )

Returned By

Too many methods to list.



Java In A Nutshell
Java In A Nutshell, 5th Edition
ISBN: 0596007736
EAN: 2147483647
Year: 2004
Pages: 1220

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net