Algorithm
Development Kit 1.0

algs.model.list
Class ListIterator<E>

java.lang.Object
  extended by algs.model.list.ListIterator<E>
Type Parameters:
E - underlying parameterization of node
All Implemented Interfaces:
java.util.Iterator<E>

public class ListIterator<E>
extends java.lang.Object
implements java.util.Iterator<E>

Provide minimal iterator to walk through the next pointers in the linked list.

Since:
1.0
Version:
1.0, 6/15/08
Author:
George Heineman

Constructor Summary
ListIterator(List<E> l)
          Constructor for iterator takes the list as parameter.
 
Method Summary
 boolean hasNext()
          Determine if there are more Nodes in the list to be reported.
 E next()
          Return the value of the next node in the list and advances the Iterator.
 void remove()
          Remove operation not supported for List objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListIterator

public ListIterator(List<E> l)
Constructor for iterator takes the list as parameter.

Parameters:
l - list to be walked through.
Method Detail

next

public E next()
Return the value of the next node in the list and advances the Iterator.

Specified by:
next in interface java.util.Iterator<E>

hasNext

public boolean hasNext()
Determine if there are more Nodes in the list to be reported.

Specified by:
hasNext in interface java.util.Iterator<E>

remove

public void remove()
Remove operation not supported for List objects.

Specified by:
remove in interface java.util.Iterator<E>

Algorithm Development Kit 1.0

This code supports the Algorithms in a Nutshell book, published by O'Reilly Media, Inc. in November 2008. Please visit the book web page to learn of any changes to the code repository or to record a potential defect.