SetMergeIterator Class

The SetMergeIterator class encapsulates the behavior required to sequentially access objects from a merged view of two or more set instances. Set instances need not have the same membership.

When iterating multiple sets, the merged iterator returns objects in a sequence based on their object identifier (oid) value.

To iterate a single collection, the iterator is created and associated with the collection by using the createIterator method on the collection object. To iterate a merged view of more than one collection, first create the iterator and then use the addCollection method for each set to be attached to the iterator, as shown in the following example.

vars
    iter : SetMergeIterator;
    set1, set2 : CustomerSet;
    cust : Customer;
begin
    // Assign set1 and set2
    create iter transient;
    iter.addCollection(set1);
    iter.addCollection(set2);
    while iter.next(cust) do
        write cust.name;
    endwhile;
end;

For details about the property and methods defined in the SetMergeIterator class, see "SetMergeIterator Property" and "SetMergeIterator Methods", in the following subsections.

Iterator

(None)