#include <coherence/util/Iterator.hpp>
Inherits Object.
Inherited by EndIterator [virtual]
, ListIterator [virtual]
, and Muterator [virtual]
.
Successive calls to next() return successive elements of the series.
For example, to print all elements of a collection hCol:
for (Iterator::Handle hIter = hCol->iterator(); hIter->hasNext(); ) { std::cout << hIter->next() << std::endl; }
Public Types | |
typedef spec::Handle | Handle |
Iterator Handle definition. | |
typedef spec::View | View |
Iterator View definition. | |
typedef spec::Holder | Holder |
Iterator Holder definition. | |
Public Member Functions | |
virtual bool | hasNext () const =0 |
Determine if the iteration has another element. | |
virtual Object::Holder | next ()=0 |
Return the next element in the iterated series. |
virtual bool hasNext | ( | ) | const [pure virtual] |
Determine if the iteration has another element.
Implemented in AbstractStableIterator, FilterMuterator, WrapperCollections::AbstractWrapperIterator, and WrapperCollections::AbstractWrapperListIterator.
virtual Object::Holder next | ( | ) | [pure virtual] |
Return the next element in the iterated series.
coherence::lang::NoSuchElementException | if iteration has no more elements |
Implemented in AbstractStableIterator, ConverterCollections::ConverterIterator, FilterMuterator, WrapperCollections::AbstractWrapperIterator, and WrapperCollections::AbstractWrapperListIterator.