Oracle Coherence for C++ API
Release 3.7.1.0

E22845-01

ListIterator Class Reference

#include <coherence/util/ListIterator.hpp>

Inherits Iterator.

Inherited by ListMuterator [virtual].

List of all members.


Detailed Description

An iterator for lists that allows the programmer to traverse the list in either direction, modify the list during iteration, and obtain the iterator's current position in the list.

A ListIterator has no current element; its cursor position always lies between the element that would be returned by a call to previous() and the element that would be returned by a call to next(). In a list of length n, there are n+1 valid index values, from 0 to n, inclusive.

Author:
nsa 2008.01.28
 

Public Types

typedef spec::Handle Handle
 ListIterator Handle definition.
typedef spec::View View
 ListIterator View definition.
typedef spec::Holder Holder
 ListIterator Holder definition.

Public Member Functions

virtual size32_t nextIndex () const =0
 Return the index of the next element to be returned from a call to next().
virtual size32_t previousIndex () const =0
 Return the index of the element to be returned from a call to previous().
virtual bool hasPrevious () const =0
 Returns true if this list iterator has more elements when traversing the list in the reverse direction.
virtual Object::Holder previous ()=0
 Returns the previous element in the list.

Member Function Documentation

virtual size32_t nextIndex (  )  const [pure virtual]

Return the index of the next element to be returned from a call to next().

Returns:
the index of the next element, or the list size if the iterator has reached the end of the list

Implemented in WrapperCollections::AbstractWrapperListIterator.

virtual size32_t previousIndex (  )  const [pure virtual]

Return the index of the element to be returned from a call to previous().

Returns:
the index of the element that would be returned from a call to previous, or List::npos if the iterator is at the start of the list.

Implemented in WrapperCollections::AbstractWrapperListIterator.

virtual bool hasPrevious (  )  const [pure virtual]

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

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

Implemented in WrapperCollections::AbstractWrapperListIterator.

virtual Object::Holder previous (  )  [pure virtual]

Returns the previous element in the list.

Returns:
the previous element in the list

Implemented in WrapperCollections::AbstractWrapperListIterator.


The documentation for this class was generated from the following file:
Copyright © 2000, 2011, Oracle and/or its affiliates. All rights reserved.