Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

java::util::Enumeration Class Reference

An object that implements the Enumeration interface generates a series of elements, one at a time. More...

#include <java_util_Enumeration.h>

Inheritance diagram for java::util::Enumeration:

Inheritance graph
[legend]
Collaboration diagram for java::util::Enumeration:

Collaboration graph
[legend]
List of all members.

Public Types

enum  {
  xmogDefaultFlags = xmog_base::GLOBAL, xmogMajorVersion = 3, xmogMinorVersion = 2, xmogPatchVersion = 9,
  xmogBuildNumber = 2047
}
typedef ::xmog_java_array_template<
::java::util::Enumeration
array1D
typedef ::xmog_java_array_template<
::xmog_java_array_template<
::java::util::Enumeration > > 
array2D

Public Member Functions

virtual bool hasMoreElements (::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Tests if this enumeration contains more elements.
virtual ::java::lang::Object nextElement (::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Returns the next element of this enumeration if this enumeration object has at least one more element to provide.

Detailed Description

An object that implements the Enumeration interface generates a series of elements, one at a time.

Successive calls to the nextElement method return successive elements of the series.

For example, to print all elements of a vector v: <blockquote>

                 for (Enumeration e = v.elements() ; e.hasMoreElements() ;) {
                     System.out.println(e.nextElement());<br>
                 }

</blockquote>

Methods are provided to enumerate through the elements of a vector, the keys of a hashtable, and the values in a hashtable. Enumerations are also used to specify the input streams to a SequenceInputStream.

NOTE: The functionality of this interface is duplicated by the Iterator interface. In addition, Iterator adds an optional remove operation, and has shorter method names. New implementations should consider using Iterator in preference to Enumeration.

Author:
Lee Boynton


Member Function Documentation

virtual bool java::util::Enumeration::hasMoreElements ::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Tests if this enumeration contains more elements.

Parameters:
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
true if and only if this enumeration object contains at least one more element to provide; false otherwise.

virtual ::java::lang::Object java::util::Enumeration::nextElement ::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Returns the next element of this enumeration if this enumeration object has at least one more element to provide.

Parameters:
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
the next element of this enumeration.


The documentation for this class was generated from the following file:
Generated on Fri Jun 16 10:19:42 2006 for JMS Courier for C++ by  doxygen 1.4.1