Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

Core::CollectionIterator Class Reference

#include <CollectionIterator.h>

Inheritance diagram for Core::CollectionIterator:

Inheritance graph
[legend]
Collaboration diagram for Core::CollectionIterator:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CollectionIterator (const Collection *coll)
virtual StringclassName (void) const
 Answer receiver class name.
virtual Objectvalue (void)
virtual long position (void)
virtual void position (long pos)
virtual bool finished (void)
virtual void next (void)

Protected Attributes

const Collectioncollection
Objectitem
int index

Constructor & Destructor Documentation

CollectionIterator::CollectionIterator const Collection coll  ) 
 

Definition at line 28 of file CollectionIterator.cc.

References collection, index, item, next(), and nil.

00029 {
00030     collection = coll;
00031     item = nil;
00032     index = -1;
00033     next();
00034 }


Member Function Documentation

String * CollectionIterator::className void   )  const [virtual]
 

Answer receiver class name.

Because there isn't any standard way to obtain class name this method comes to place.

Every class should rewrite this method but many didn't (yet).

Reimplemented from Core::Object.

Reimplemented in Core::KeysAndValuesIterator.

Definition at line 37 of file CollectionIterator.cc.

00038 {
00039     return new String("CollectionIterator");
00040 }

bool CollectionIterator::finished void   )  [virtual]
 

Reimplemented from Core::Iterator.

Definition at line 59 of file CollectionIterator.cc.

References Core::Collection::capacity(), collection, and index.

Referenced by Tools::Configuration::keys(), next(), and Tools::Configuration::reloadAll().

00060 {
00061     return index >= collection->capacity();
00062 }

void CollectionIterator::next void   )  [virtual]
 

Reimplemented from Core::Iterator.

Definition at line 65 of file CollectionIterator.cc.

References collection, finished(), index, item, nil, and Core::Collection::privNextForIterator().

Referenced by CollectionIterator(), Tools::Configuration::keys(), and Tools::Configuration::reloadAll().

00066 {
00067     index++;
00068     if (!finished()) item = collection->privNextForIterator(this);
00069                 else item = nil;
00070 }

void CollectionIterator::position long  pos  )  [virtual]
 

Definition at line 53 of file CollectionIterator.cc.

References index.

00054 {
00055     index = pos;
00056 }

long CollectionIterator::position void   )  [virtual]
 

Definition at line 48 of file CollectionIterator.cc.

References index.

Referenced by Core::Set::privNextForIterator(), Core::SequenceableCollection::privNextForIterator(), and Core::Array::privNextForIterator().

00049 {
00050     return index;
00051 }

Object * CollectionIterator::value void   )  [virtual]
 

Reimplemented from Core::Iterator.

Reimplemented in Core::KeysAndValuesIterator.

Definition at line 43 of file CollectionIterator.cc.

References item.

00044 {
00045     return item;
00046 }


Member Data Documentation

const Collection* Core::CollectionIterator::collection [protected]
 

Definition at line 36 of file CollectionIterator.h.

Referenced by CollectionIterator(), finished(), and next().

int Core::CollectionIterator::index [protected]
 

Definition at line 38 of file CollectionIterator.h.

Referenced by CollectionIterator(), finished(), next(), and position().

Object* Core::CollectionIterator::item [protected]
 

Definition at line 37 of file CollectionIterator.h.

Referenced by CollectionIterator(), Core::KeysAndValuesIterator::key(), next(), Core::KeysAndValuesIterator::value(), and value().


The documentation for this class was generated from the following files:
Generated on Mon Nov 27 09:51:18 2006 for Smalltalk like C++ Class Library by  doxygen 1.4.2