#include <iterator.h>
Public Member Functions | |
ListIterator () | |
bool | hasNext () const |
bool | hasPrevious () const |
T & | next () throw ( NoSuchObject ) |
T & | previous () throw ( NoSuchObject ) |
void | printInternal () const |
Private Attributes | |
Node< T > * | current |
bool | before |
Friends | |
class | List< T > |
Implements a bidirectional iterator for List.
ListIterator< T >::ListIterator | ( | ) |
Default constructor.
bool ListIterator< T >::hasNext | ( | ) | const |
Returns true if this iterator has a next object.
bool ListIterator< T >::hasPrevious | ( | ) | const |
Returns true if this iterator has a previous object.
T & ListIterator< T >::next | ( | ) | ||
throw | ( | NoSuchObject | ||
) |
Returns a reference to the next object in this iterator.
NoSuchObject | if no such object exists in this iterator |
T & ListIterator< T >::previous | ( | ) | ||
throw | ( | NoSuchObject | ||
) |
Returns a reference to the previous object in this iterator.
NoSuchObject | if no such object exists in this iterator |
void ListIterator< T >::printInternal | ( | ) | const |
A utility method that prints the internal state of this iterator.