Enumerator Interface

All the collections that support enumeration implement the Enumerator interface. The Enumerator interface supports the standard Java enumeration interface, java.util.Enumeration, and extends it with methods to make it functionally equivalent to the standard automation enumerator, IEnumVariant. For example, all objects that implement Enumerator must implement Cloneable, and the reset member can be used to set the enumerator to the beginning of the collection.

public interface Enumerator extends Cloneable, java.util.Enumeration {
public void reset();
// From java.util.Enumeration
public boolean hasMoreElements();
public Object nextElement() throws NoSuchElementException;
// From Cloneable
public Object clone();
}

Enumerator Methods

public void reset( );

Resets the Enumerator to the beginning of the collection.

java.util.Enumeration Methods

public Boolean hasMoreElements( );

Returns true if there are any remaining items in the collection that can be obtained by calling nextElement.

public Object nextElement( ) throws NoSuchElementException;

Returns the next Object in the collection. You typically call this method following a call to hasMoreElements.

java.lang.Cloneable Methods

public Object clone( );

Makes a copy of the Enumerator, with the current state.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.