activemq-cpp-3.4.0
|
Defines an object that can be used to iterate over the elements of a collection. More...
#include <src/main/decaf/util/Iterator.h>
Public Member Functions | |
virtual | ~Iterator () |
virtual E | next ()=0 |
Returns the next element in the iteration. | |
virtual bool | hasNext () const =0 |
Returns true if the iteration has more elements. | |
virtual void | remove ()=0 |
Removes from the underlying collection the last element returned by the iterator (optional operation). |
Defines an object that can be used to iterate over the elements of a collection.
The iterator provides a way to access and remove elements with well defined semantics.
virtual decaf::util::Iterator< E >::~Iterator | ( | ) | [inline, virtual] |
virtual bool decaf::util::Iterator< E >::hasNext | ( | ) | const [pure virtual] |
Returns true if the iteration has more elements.
Returns false if the next call to next would result in an NoSuchElementException to be thrown.
Implemented in decaf::util::concurrent::CopyOnWriteArrayList< E >::ArrayListIterator.
virtual E decaf::util::Iterator< E >::next | ( | ) | [pure virtual] |
Returns the next element in the iteration.
Calling this method repeatedly until the hasNext() method returns false will return each element in the underlying collection exactly once.
NoSuchElementException | if the iteration has no more elements. |
Implemented in decaf::util::concurrent::CopyOnWriteArrayList< E >::ArrayListIterator.
virtual void decaf::util::Iterator< E >::remove | ( | ) | [pure virtual] |
Removes from the underlying collection the last element returned by the iterator (optional operation).
This method can be called only once per call to next. The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method.
UnsupportedOperationException | if the remove operation is not supported by this Iterator. |
IllegalStateException | if the next method has not yet been called, or the remove method has already been called after the last call to the next method. |
Implemented in decaf::util::concurrent::CopyOnWriteArrayList< E >::ArrayListIterator.