00001 #include "CollectionIterator.h" 00002 00003 #include "ObjectLink.h" 00004 #include "ObjectCollection.h" 00005 00006 CollectionIterator::CollectionIterator (ObjectCollection *pOn) 00007 /* : Collection(pOn), Position(pOn->First) */ 00008 { 00009 this->Collection = pOn; 00010 this->Position = pOn->First; 00011 } 00012 00013 CollectionIterator::~CollectionIterator () { 00014 } 00015 00016 Object *CollectionIterator::GetNext() { 00017 if (this->AnyMoreObjects()) { 00018 Object *anObject; 00019 anObject = this->Position->GetValue(); 00020 this->Position = this->Position->GetNext(); 00021 return anObject; 00022 } else 00023 return 0; 00024 } 00025 00026 bool CollectionIterator::AnyMoreObjects () { 00027 return (this->Position != 0); 00028 } 00029