ArrayList< T >::Iterator Class Reference

Iterator class for an array list. More...

#include <rimPhysicsArrayList.h>

List of all members.

Public Member Functions

 Iterator (ArrayList< T > &newList)
 create a new linked list iterator from a reference to a list.
next ()
 Return the next element in the list.
bool hasNext () const
 Return whether or not the iterator is at the end of the list.
void remove ()
 Remove the last element that was iterated over.
void reset ()
 Reset the iterator to the beginning of the list.
int getNextIndex () const
 Get the index of the next element to be iterated over.

Private Attributes

int position
 The current position of the iterator.
ArrayList< T > & list
 A reference to the list we are iterating over.


Detailed Description

template<typename T>
class ArrayList< T >::Iterator

Iterator class for an array list.

The purpose of this class is to iterate through all or some of the elements in the array list, making changes as necessary to the elements.


Constructor & Destructor Documentation

template<typename T>
ArrayList< T >::Iterator::Iterator ( ArrayList< T > &  newList  )  [inline]

create a new linked list iterator from a reference to a list.


Member Function Documentation

template<typename T>
T ArrayList< T >::Iterator::next (  )  [inline]

Return the next element in the list.

This method throws a rimNoSuchElementException if hasNext() is equal to FALSE.

Returns:
the next element of the list or NULL if there is none.

template<typename T>
bool ArrayList< T >::Iterator::hasNext (  )  const [inline]

Return whether or not the iterator is at the end of the list.

If the iterator is at the end of the list, return FALSE. Otherwise, return TRUE.

Returns:
FALSE if at the end of list, otherwise TRUE

template<typename T>
void ArrayList< T >::Iterator::remove (  )  [inline]

Remove the last element that was iterated over.

template<typename T>
void ArrayList< T >::Iterator::reset (  )  [inline]

Reset the iterator to the beginning of the list.

template<typename T>
int ArrayList< T >::Iterator::getNextIndex (  )  const [inline]

Get the index of the next element to be iterated over.


Member Data Documentation

template<typename T>
int ArrayList< T >::Iterator::position [private]

The current position of the iterator.

template<typename T>
ArrayList<T>& ArrayList< T >::Iterator::list [private]

A reference to the list we are iterating over.


The documentation for this class was generated from the following file:
Generated on Tue Aug 26 00:03:17 2008 for Rim Physics by  doxygen 1.5.4