CS 596 Fall Semester, 1998 Assignment 3 Test Data | ||
---|---|---|
San Diego State University -- This page last updated 12-Oct-98 |
public static void TestOne() throws CloneNotSupportedException { SortedLinkedList stringList = new SortedLinkedList( StringComparer.getInstance() ); System.out.println( "Empty String list : " + stringList ); stringList.add( "d" ); stringList.add( "a" ); stringList.add( "f" ); stringList.add( "b" ); stringList.add( "e" ); System.out.println( "Full String list : " + stringList ); System.out.print( "Enumeration on String list : " ); Enumeration list = stringList.elements(); while ( list.hasMoreElements() ) System.out.print( "" + list.nextElement() + "\t" ); System.out.println( ); SortedLinkedList aClone =(SortedLinkedList) stringList.clone(); stringList.add( "c" ); System.out.println( "Clone : " + aClone ); System.out.println( "Changed string list : " + stringList ); }
public static void TestTwo() { SortedLinkedList integerList = new SortedLinkedList( IntegerComparer.getInstance() ); System.out.println( "Empty Integer list : " + integerList ); integerList.add( new Integer( 9) ); integerList.add( new Integer( 7) ); integerList.add( new Integer( 5) ); integerList.add( new Integer( 3) ); integerList.add( new Integer( 1) ); System.out.println( "Full Integer list : " + integerList ); }