FileDocCategorySizeDatePackage
LinkListTest.javaAPI DocExample1078Sun Feb 29 12:52:44 GMT 2004None

LinkListTest

public class LinkListTest extends TestCase
Linked list class, written out in full using Java.
deprecated
Supplanted by java.util.LinkedList
author
Ian Darwin, http://www.darwinsys.com/

Fields Summary
LinkList
list
Constructors Summary
Methods Summary
public voidsetUp()

		System.out.println("Here is a demo of implementing a List in Java");
		System.out.println("(you know it don't come easy....)");
		list = new LinkList();
		list.add(new Object());
		list.add("Hello");
		list.add("End of list");
		System.out.println("Here is a list of all the elements, from get");
		System.out.println(list.get(0));
		System.out.println(list.get(1));
		System.out.println(list.get(2));
	
public voidtestGet()


		assertTrue(list.lookup("Hello"));
		System.out.println("Lookup seems to work");
	
public voidtestIterator()


		Iterator li = list.iterator();
		assertNotNull(li);

		// Run the list frontwards
		while (li.hasNext()) {
			System.out.println("Next to: " + li.next());
		}
	
public voidtestSize()

		assertEquals(3, list.size());