activemq-cpp-3.6.0
decaf::util::concurrent::CopyOnWriteArrayList< E >::ArrayListIterator Class Reference

#include <src/main/decaf/util/concurrent/CopyOnWriteArrayList.h>

Inheritance diagram for decaf::util::concurrent::CopyOnWriteArrayList< E >::ArrayListIterator:

Public Member Functions

 ArrayListIterator (decaf::lang::Pointer< Array > array, int index)
virtual ~ArrayListIterator ()
virtual E next ()
 Returns the next element in the iteration.
virtual bool hasNext () const
 Returns true if the iteration has more elements.
virtual void remove ()
 Removes from the underlying collection the last element returned by the iterator (optional operation).
virtual void add (const E &e DECAF_UNUSED)
virtual void set (const E &e DECAF_UNUSED)
virtual bool hasPrevious () const
 Returns true if this list iterator has more elements when traversing the list in the reverse direction.
virtual E previous ()
 Returns the previous element in the list.
virtual int nextIndex () const
 Returns the index of the element that would be returned by a subsequent call to next.
virtual int previousIndex () const
 Returns the index of the element that would be returned by a subsequent call to previous.
- Public Member Functions inherited from decaf::util::ListIterator< E >
virtual ~ListIterator ()
virtual void add (const E &e)=0
 Inserts the specified element into the list (optional operation).
virtual void set (const E &e)=0
 Replaces the last element returned by next or previous with the specified element (optional operation).
- Public Member Functions inherited from decaf::util::Iterator< E >
virtual ~Iterator ()

Constructor & Destructor Documentation

template<typename E>
decaf::util::concurrent::CopyOnWriteArrayList< E >::ArrayListIterator::ArrayListIterator ( decaf::lang::Pointer< Array >  array,
int  index 
)
inline
template<typename E>
virtual decaf::util::concurrent::CopyOnWriteArrayList< E >::ArrayListIterator::~ArrayListIterator ( )
inlinevirtual

Member Function Documentation

template<typename E>
virtual void decaf::util::concurrent::CopyOnWriteArrayList< E >::ArrayListIterator::add ( const E &e  DECAF_UNUSED)
inlinevirtual
template<typename E>
virtual bool decaf::util::concurrent::CopyOnWriteArrayList< E >::ArrayListIterator::hasNext ( ) const
inlinevirtual

Returns true if the iteration has more elements.

Returns false if the next call to next would result in an NoSuchElementException to be thrown.

Returns
true if there are more elements available for iteration.

Implements decaf::util::Iterator< E >.

template<typename E>
virtual bool decaf::util::concurrent::CopyOnWriteArrayList< E >::ArrayListIterator::hasPrevious ( ) const
inlinevirtual

Returns true if this list iterator has more elements when traversing the list in the reverse direction.

(In other words, returns true if previous would return an element rather than throwing an exception.)

Returns
true if the list iterator has more elements when traversing the list in the reverse direction.

Implements decaf::util::ListIterator< E >.

template<typename E>
virtual E decaf::util::concurrent::CopyOnWriteArrayList< E >::ArrayListIterator::next ( )
inlinevirtual

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.

Returns
the next element in the iteration of elements.
Exceptions
NoSuchElementExceptionif the iteration has no more elements.

Implements decaf::util::Iterator< E >.

template<typename E>
virtual int decaf::util::concurrent::CopyOnWriteArrayList< E >::ArrayListIterator::nextIndex ( ) const
inlinevirtual

Returns the index of the element that would be returned by a subsequent call to next.

(Returns list size if the list iterator is at the end of the list.)

Returns
the index of the element that would be returned by a subsequent call to next, or list size if list iterator is at end of list.

Implements decaf::util::ListIterator< E >.

template<typename E>
virtual E decaf::util::concurrent::CopyOnWriteArrayList< E >::ArrayListIterator::previous ( )
inlinevirtual

Returns the previous element in the list.

This method may be called repeatedly to iterate through the list backwards, or intermixed with calls to next to go back and forth. (Note that alternating calls to next and previous will return the same element repeatedly.)

Returns
the previous element in the list.
Exceptions
NoSuchElementExceptionif the iteration has no previous element.

Implements decaf::util::ListIterator< E >.

template<typename E>
virtual int decaf::util::concurrent::CopyOnWriteArrayList< E >::ArrayListIterator::previousIndex ( ) const
inlinevirtual

Returns the index of the element that would be returned by a subsequent call to previous.

(Returns -1 if the list iterator is at the beginning of the list.)

Returns
the index of the element that would be returned by a subsequent call to previous, or -1 if list iterator is at beginning of list.

Implements decaf::util::ListIterator< E >.

template<typename E>
virtual void decaf::util::concurrent::CopyOnWriteArrayList< E >::ArrayListIterator::remove ( )
inlinevirtual

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.

Exceptions
UnsupportedOperationExceptionif the remove operation is not supported by this Iterator.
IllegalStateExceptionif the next method has not yet been called, or the remove method has already been called after the last call to the next method.

Implements decaf::util::Iterator< E >.

template<typename E>
virtual void decaf::util::concurrent::CopyOnWriteArrayList< E >::ArrayListIterator::set ( const E &e  DECAF_UNUSED)
inlinevirtual

The documentation for this class was generated from the following file: