ListIterator< T > Class Template Reference

#include <iterator.h>

List of all members.

Public Member Functions

 ListIterator ()
void add (const T &object)
bool hasNext () const
bool hasPrevious () const
T & next () throw ( NoSuchObject )
T & previous () throw ( NoSuchObject )
void set (const T &)
void printInternal () const

Private Attributes

Node< T > * current
bool atFront
bool atEnd

Friends

class List< T >

Detailed Description

template<typename T>
class ListIterator< T >

Implements a bidirectional iterator for List.

Author:
Mark Maloof
Version:
1.0, 3/25/10

Constructor & Destructor Documentation

template<typename T >
ListIterator< T >::ListIterator (  )  [inline]

Default constructor.


Member Function Documentation

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

Returns true if this iterator has a next object.

Returns:
true if this iterator has a next object; false otherwise.
template<typename T >
bool ListIterator< T >::hasPrevious (  )  const [inline]

Returns true if this iterator has a previous object.

Returns:
true if this iterator has a previous object; false otherwise.
template<typename T >
T & ListIterator< T >::next (  )  throw ( NoSuchObject ) [inline]

Returns a reference to the next object in this iterator.

Returns:
a reference to the next object
Exceptions:
NoSuchObject if no such object exists in this iterator
template<typename T >
T & ListIterator< T >::previous (  )  throw ( NoSuchObject ) [inline]

Returns a reference to the previous object in this iterator.

Returns:
a reference to the previous object
Exceptions:
NoSuchObject if no such object exists in this iterator
template<typename T >
void ListIterator< T >::printInternal (  )  const [inline]

A utility method that prints the internal state of this iterator.

template<typename T >
void ListIterator< T >::set ( const T &  object  )  [inline]

Sets the object at the position of this iterator to the specified object.

Parameters:
object the object to be set

The documentation for this class was generated from the following file:
Generated on Thu Mar 24 15:12:01 2011 by  doxygen 1.6.3