This website is preserved for historical and scholarly reference and is no longer actively maintained.
                         CpSc 210, Section 1
                             Assignment 9 
                            April 11, 2002


Due:  Friday, April 19 at 11:59 p.m.  

Assignment:  Add an external iterator for the ArrayList class.

Total point value of assignment:  50 points
Not accepted late.

This assignment is to be done INDIVIDUALLY.

Assignment:  Your ArrayList.java file needs to have the following:

	import structure.QueueArray     // Bailey's QueueArray implementation
	import structure.List;          // Bailey's List interface
	import structure.Iterator;      // Bailey's Iterator interface

	public class ArrayList extends QueueArray implements List
	{


You will need to code the elements() method to your ArrayList class.
In a separate file (ArrayListIterator.java) implement an external
iterator for the ArrayList.  You will need:

	import structure.Iterator

	public class ArrayListIterator implements Iterator
	{


The Iterator interface is given on page 157 of Java Structures.  Your
program should include every method of the interface.  The elements
method should send whatever parameters are needed to the constructor
for the iterator.  

You will submit both ArrayList.java and ArrayListIterator.java at
the same time using the handin command.  Even if your previous
ArrayList.java worked perfectly, submit it again, this time to
Assignment 9.


Grading Rubric:

    reasonable attempt to solve problem as assigned
    also compiles (both classes)
    style standards (includes clarity)

    The following points are available only for code that compiles 
    and runs without error.   Some considerations are:

    elements() method does NOT copy array from ArrayList.  
       Instead, a reference to the array must be passed.  Only simple
       variables and references are passed to Iterator. 

    code works correctly       
    elegance of code

    include a test driver that has three iterators concurrently
	   traversing the same list.



Other requirements: The first operation of your main program must be to print "CPSC 210", your name, the assignment number, and a brief description of the assignment.

Follow the style standards to be found on your instructor's web page for CPSC 210. Submit your program using the handin command. There is a link to the handin description on the CPSC 210 lab page (www.cs.clemson.edu/~lab210).