Iterating using Interfaces (JAD-I-571)

The foreach instruction has been extended to support iterating with the JadeIterableIF interface, which provides the contract for an implementing class to be able to be iterated. JadeIterableIF simply exposes a JadeIteratorIF implementation through its createIterator method. This exposed JadeIteratorIF implementation can then be used to iterate the JadeIterableIF receiver.

A JadeIterableIF interface instance, or similarly a JadeIterableIF implementor instance, can be the target of a foreach instruction. For details, see "Iterating using the JadeIterableIF Interface", in Chapter 1 of the JADE Developer's Reference.

The JadeIterableIF interface is implemented by the RootSchema Collection class, which satisfies the createIterator method by creating RootSchema Iterator class instances.

For details about implementing the JadeIterableIF interface for a class selected in the Class Browser of a user schema, see "Implementing an Interface", in Chapter 14 (Adding and Maintaining Interfaces"), of the JADE Development Environment User’s Guide. See also "Processing and Obtaining Information about Dynamic Objects", elsewhere in this document.