Index

DKFederatedIterator

Purpose:

DKFederatedIterator is used to iterate over the collective members of DKFederatedCollection across collection boundaries. The next() method will returns DDO objects until all collections are iterated over. This iterator is created by invoking the method createIterator() in the DKFederatedCollection object.

Class summary:

DKFederatedIterator.hpp
 class DKFederatedIterator: public DKSequentialIterator
 {
   public:
      DKFederatedIterator(const DKFederatedCollection& fromCollection);
      DKFederatedIterator(const DKFederatedIterator& fromIterator);
      virtual ~DKFederatedIterator();
  
      virtual DKAny *next();
      virtual void   reset();
      virtual DKBoolean more();
  
      // from DKSequentialIterator
      virtual DKAny*    previous();
      virtual DKAny*    at();
      virtual DKBoolean setToFirst();     
      virtual DKBoolean setToLast();     
      virtual DKBoolean setToNext();     
      virtual DKBoolean setToPrevious();     
      
      // new methods
      virtual DKBoolean setToFirstCollection();     
      virtual DKBoolean setToLastCollection();     
      virtual DKBoolean setToNextCollection();     
      virtual DKBoolean setToPreviousCollection();     
  
 };

Members:

Member functions

next
Returns the current element in the collection and advances the iterator to the next position. In case the element is a collection, it goes inside that collection and retrieves the first element recursively until it finds an element which is not a collection. When the current collection is exhausted, this iterator will find the next collection and extract the first element (non-collection) from it.
virtual DKAny *next();

reset
Resets the iterator to the beginning of DKFederatedCollection.
virtual void   reset();

more
Returns TRUE if there are more elements in the DKFederatedCollection. In this case, an element implicitly means a collection member which is not a collection (a leaf).
virtual DKBoolean more();

previous
Returns the current element in the collection and moves the iterator backward one position. In case the element is a collection, it goes inside that collection and retrieves the last element until it finds an element which is not a collection. When the current collection is exhausted, this iterator will find the previous collection and extract the last element (non-collection) from it.
 virtual DKAny*    previous();

at
Returns the current element in the collection without moving the iterator position. The returned element is not a collection.
virtual DKAny*    at();

setToFirst
Set the iterator to the first element in this federated collection. The first element is not a collection. Returns TRUE if the operation is successful.
virtual DKBoolean setToFirst();  

setToLast
Set the iterator to the last element in this federated collection. The last element is not a collection. Returns TRUE if the operation is successful.
virtual DKBoolean setToLast(); 

setToNext
Set the iterator to the next element in this federated collection. The next element is not a collection. Returns TRUE if the operation is successful.
virtual DKBoolean setToNext();  

setToPrevious
Set the iterator to the previous element in this federated collection. The previous element is not a collection. Returns TRUE if the operation is successful.
virtual DKBoolean setToPrevious(); 

setToFirstCollection
Set the iterator to the first element in the first collection in this federated collection. The first element is not a collection. Returns TRUE if the operation is successful.
 virtual DKBoolean setToFirstCollection();

setToLastCollection
Set the iterator to the last element in the last collection in this federated collection. The last element is not a collection. Returns TRUE if the operation is successful.
virtual DKBoolean setToLastCollection(); 

setToNextCollection
Set the iterator to the first element in the next collection in this federated collection. The first element is not a collection. Returns TRUE if the operation is successful.
virtual DKBoolean setToNextCollection(); 

setToPreviousCollection
Set the iterator to the last element in the previous collection in this federated collection. The first last is not a collection. Returns TRUE if the operation is successful.
virtual DKBoolean setToPreviousCollection();    

(c) Copyright International Business Machines Corporation 1996, 2003. IBM Corp. All rights reserved.