The Enumeration Interface

The Enumeration interface defines the methods by which you can rate(obtain( one at a time) the elements in a collection of objects. This legacy interface has been superseded by Iterator, Although not deprecated, Enumeration is considered obsolete for new code. However, it is used by several methods defined by the legacy classes (such as Vector and Propertiesj.js used by several other API classes, and is currently in widespread use in application-code. Enumeration specifics the following two methods:
Boolean has More Elements( )
Object next Element( )
When implemented, has More Elements( ) must return true while there are still-more elements to extract, and false when all the elements have been enumerated. next. Element( ) returns the next object in the enumeration as a gilder Object reference . . That is, each call to next Element( ) obtains the next object in the enumeration. The calling routine must cast that object into the object type held in the enumeration.

Share This