Index

DKSequentialIterator

Purpose:

A sequential iterator is bidirectional; it can go forwards and backwards over members of a collection that supports it.

In general, iterators are usually created by the corresponding collections that support them by calling the method createIterator().

Class summary:

class DKSequentialIterator: public dkIterator
{
public:
   DKSequentialIterator(const DKSequentialCollection& fromCollection);
   DKSequentialIterator(const DKSequentialIterator& fromIterator);
   virtual DKSequentialIterator() {};
 
   virtual DKAny* next();
   virtual void   reset();
   virtual DKBoolean more();
 
   virtual DKAny* previous();
   virtual DKAny* at();
   virtual DKBoolean setToFirst();
   virtual DKBoolean setToLast();
   virtual DKBoolean setToNext();
   virtual DKBoolean setToPrevious();
};

Members:

Constructors and destructor
DKSequentialIterator(const DKSequentialCollection& fromCollection);
DKSequentialIterator(const DKSequentialIterator& fromIterator);
virtual DKSequentialIterator() {};

Member functions

next
Returns the current element in the collection, and advances the iterator to the next element.
 virtual DKAny* next();

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

more
Returns TRUE if more elements are in the collection.
virtual DKBoolean more();

previous
Returns the current element in the collection and repositions the iterator at the previous element.
virtual DKAny* previous();

at
Returns the current element in the collection.
virtual DKAny* at();

setToFirst
Sets to the first element in the collection.
virtual DKBoolean setToFirst();

setToLast
Sets to the last element in the collection.
virtual DKBoolean setToLast();

setToNext
Sets to the next element in the collection.
virtual DKBoolean setToNext();

setToPrevious
Sets to the previous element in the collection.
virtual DKBoolean setToPrevious();

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